javascript - Casper JS 在点击时卡住了
问题描述
我是新手casperJS
,我正在尝试填写表格。当我单击按钮时,this.click('input[type="button"][value="Add"][class="ui-btn-hidden"]');
我会在控制台中看到一些输出,即单击按钮时的控制台输出,例如
我在终端中看到相同的输出,我的脚本卡住了,我看到了错误Wait timeout of 10000ms expired, exiting.
执行点击后如何不等待输出直接跳到下一步?
编辑 我的代码是
casper.then(function () {
this.evaluate(function () {
if (!$('#add-button').is(':visible')){
this.echo("add button visible");
$('#yourHeader').click();
this.echo("add button clicked");
}
$('#add-header').click();
this.echo("add header clicked");
});
this.waitUntilVisible('input[id="newAmount"]');
this.capture(CapturePath('add_form.png'));
this.evaluate(function () {
$("#newType option:contains('Direct')").prop('selected', true).change();
this.echo(" type selected");
});
this.capture(CapturePath('filledForm.png'));
this.sendKeys('input[id="newAmount"]', Balance);
this.echo("new amount set as "+loanBalance);
this.capture(CapturePath('filledFormamount.png'));
this.sendKeys('input[id="newInterest"]', interestRate);
this.echo("new interest rate set as "+interestRate);
this.capture(CapturePath('filledFormInterest.png'));
this.echo('clicking ui-btn-hidden');
this.click('input[type="button"][value="Add"][class="ui-btn-hidden"]');
this.capture(CapturePath('CompletedForm.png'));
this.capture(CapturePath('selectFound.png'));
this.echo("here I am");
});
casper.run(function () {
this.echo('Done').exit();
});
我从来没有看到用这段代码完成
解决方案
推荐阅读
- javascript - dhtmlx Gantt:如何自动更新自定义日期列的父级
- java - 如何在另一个 Java 项目中使用整个 Java 项目并实例化和使用类和方法?
- android - android.database.sqlite.SQLiteException: no such table: SimpleTable (code 1 SQLITE_ERROR[1]): , while compile: SELECT * FROM SimpleTable
- class-validator - 使字段可选,但如果设置则让它依赖于其他字段
- android - Android 软件包名称 Dex 问题
- reactjs - React + Spring - 感觉迟钝
- javascript - 用于多人游戏的 Socket.io 与 WebRTC DataChannel
- java - 在 kafka 中应用 SMT 后删除接收器数据库中的行不起作用
- android - 我正在学习 Nativescript,我被困在一个创建国家、州和城市列表视图的场景中
- php - Understanding how calling a protected method belonging to one object works under a different object