最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - WebDriver.io: how to make browser pause wait? - Stack Overflow

programmeradmin0浏览0评论

For testing, I am loading a page and clicking a button, I am using webdriver.io for testing Since the page is quite heavy, it takes a bit of time to load, I would like the global variable browser to wait few seconds before clicking the button.

I know there is waitForVisible method, but not good enough, I still have no idea if the js has added click event to the button, I am looking for something similar to sleep method in selenium webdriver.

For testing, I am loading a page and clicking a button, I am using webdriver.io for testing Since the page is quite heavy, it takes a bit of time to load, I would like the global variable browser to wait few seconds before clicking the button.

I know there is waitForVisible method, but not good enough, I still have no idea if the js has added click event to the button, I am looking for something similar to sleep method in selenium webdriver.

Share Improve this question asked Apr 29, 2016 at 2:41 midomido 25.1k15 gold badges99 silver badges122 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 5

I think you are asking about the pause() method:

pauses queue execution for a specific amount of time

Since using pause() is not a good practice, you can use waitForExist() as an alternative

发布评论

评论列表(0)

  1. 暂无评论