Friday, January 23, 2015

Waits

Implicit Waits
  • Default setting for "wait" is 0
  • Set once and its use is continue through the life of the webdriver instance
  • Waits for the presence of the web element 
Explicit Waits
  • Define certain condition on the webelement
  • Define the wait period
  • Able to use convenience methods from the ExpectedConditions class (Java API)
  • Able to create more elaborate wait methods - FluentWaits (Java API)



Why
  • Waits allow the webdriver and the HTML code to stay synchronized; therefore, when the webdriver tries to interact with webelements on the page, those webelements are "ready" for use.
When
  • Any call of a new page object
Where
  • From the page object itself (returning this or a boolean)

Disclaimer - These are my technical notes around Selenium, various code and frameworks.