WebDriver Exploration Part-3(WebDriver Waits)
You may come across scenario's where you see elements on pages are loaded after some delay or after some specific event. In such a case, our scripts can fail and complain it cannot find the element. To tackle such scenario's we can have our script developed in such a way that it will wait for some predefined time before interacting with such type of elements We will stick to our earlier example of clicking Gmail link on google home page, here we assume Gmail link appears after some delay on the home page, below are the ways we can tackle this Sleeping till things appear on the page 😴 Yes. Sleeping till things get to normal. Assuming that Gmail link appears within 10 seconds after the page is loaded, we can sleep for 10 seconds before interacting with it, check below [ TestMethod ] public void Verify_Wait_Sleep() { ...