O'Reilly logo

Mastering Selenium WebDriver by Mark Collin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

I just want Selenium to do it for me

Well, you do have some options available if you just want Selenium to try and do things for you. Selenium has three built-in waiting mechanisms that you can configure universally by configuring the Timeouts() object, which is set on your driver object when you instantiate it.

The following are the available mechanisms:

  • The page load timeout
  • The script timeout
  • The implicit wait timeout

Let's have a look at these mechanisms in some more detail.

The page load timeout

This defines the amount of time that Selenium will wait for a page to load. By default, it is set to 0 (which equates to an infinite timeout). If you want to ensure that an error is thrown if your page takes longer than expected to load, you can modify this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required