mido
mido

Reputation: 25034

WebDriver.io: how to make browser pause/ wait?

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.

Upvotes: 2

Views: 8930

Answers (2)

Sahilgrewalhere
Sahilgrewalhere

Reputation: 319

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

Upvotes: 2

alecxe
alecxe

Reputation: 474001

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

pauses queue execution for a specific amount of time

Upvotes: 5

Related Questions