简体   繁体   English

使用量角器时,单击导致发出http请求的按钮时,我收到此消息:等待量角器同步时出错

[英]While using Protractor, when clicking a button which causes an http request to be made, I receive this: error while waiting for protractor to sync

describe("I should see a a list of cars to add ", function() {
  var add_car_button = element(by.id('add_car'));
  add_car_btn.click() // Failure, can't continue on from here
  // assertions to follow...
});

The error received from Protractor when running the test: 运行测试时从量角器收到的错误:

error while waiting for protractor to sync 等待量角器同步时出错

The add_car_btn will send the user to a new page where a list of cars (gathered via an http get request) will be displayed to the user. add_car_btn会将用户发送到新页面,在该页add_car_btn将向用户显示汽车列表(通过http get请求收集)。 How can I successfully instruct the webdriver to click the button without failing to continue onward? 如何成功指示网络驱动程序单击按钮而又不继续前进?

将失败的代码放在beforeEach块中是一种成功的解决方法,请参见https://github.com/angular/protractor/issues/376

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 量角器“等待量角器与页面同步时出错”浏览Angular站点 - Protractor “Error while waiting for Protractor to sync with the page” browsing Angular site 在等待量角器与页面同步时刷新时发生错误,在捕获警报时 - Error while waiting for protractor to sync with the page on catching alert during refresh 执行量角器测试时出现“失败:等待量角器与页面同步时出错” - "Failed: Error while waiting for Protractor to sync with the page" while executing Protractor tests 等待量角器与页面同步时出错:在运行量角器测试用例时“在窗口中找不到角度” - Error while waiting for Protractor to sync with the page: “angular could not be found on the window” on running protractor test case 失败:等待量角器与页面同步时出错:“在窗口中找不到角度” - Failed: Error while waiting for Protractor to sync with the page: “angular could not be found on the window” 带有 protractorjs 的 Angular 2 失败:等待 Protractor 与页面同步时出错:“window.getAllAngularTestabilities 不是函数” - Angular 2 with protractorjs Failed: Error while waiting for Protractor to sync with the page: "window.getAllAngularTestabilities is not a function" 使用$ resource时,量角器会等待与页面同步 - Protractor times out waiting for sync with page when using $resource 使用量角器和cucumberjs选择单选按钮选项时出错 - Error while selecting radio button option using protractor and cucumberjs 谁能建议如何处理我在使用调用 Post 并通过 protractor 获取 Http 方法时遇到的错误? - Can anyone suggest how to handle the error which i was facing when using to call an Post and get Http methods through protractor? 使用量角器单击复选框 - Clicking a checkbox using protractor
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM