Page Load Timeout in Selenium

Let’s understand what is Page Load timeout in Selenium. In Selenium, there is no method, which can calculate the Page loading time.

But we can define, In what time the page should get the load. The problem majorly noticed with IE that many websites take a bit time to get loaded.

 

Using Timeout property we can test this. We can define the expected time to page load in test identical conditions and verify that actually page is getting loaded within the given time frame or not.

If Page will not load completely within the given time then selenium will throw the TimeoutException in the console.

It also helps us to Test Web page which has multiple frames. It can be noticed IE8 or IE9 sometimes hang with pages which implement multiple frames.

 

Let’s take an example, We suppose that Selenitic home page should get the load within 5 seconds. So we can Test this like this –

 

The above code will verify that page is getting the load with expected time(5 Sec) or not.

You can copy the above code and perform test with different browsers.

Please make sure, If you will not practice the things, You might forget them easily. So practice each and every tutorial to make grip over the selenium.

0 Comment

Leave a Reply