Custom message on wait timeout error

寵の児 提交于 2019-12-01 11:03:10

I believe browser.wait() takes 3 parameters: a condition, an optional timeout, and an optional description message. (I'm pretty sure this is the doc: http://angular.github.io/protractor/#/api?view=webdriver.WebDriver.prototype.wait, but I'm having a hard time verifying that the WebDriver shows up as browser in protractor). So you should be able to do:

var EC = protractor.ExpectedConditions;
var timeoutMS = 10 * 1000;
var timeoutMsg = "Waiting for header displayName";
browser.wait(EC.visibilityOf(header.displayName), timeoutMS, timeoutMsg);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!