Introduction
While building test automation for a complex web application using Selenium WebDriver, we need to ensure that the test flow is maintained for reliable test automation.
When tests are run, the application may not always respond with the same speed. For example, it might take a few seconds for a progress bar to reach 100 percent, a status message to appear, a button to become enabled, and a window or pop-up message to open.
You can handle these anticipated timing problems by synchronizing your test to ensure that Selenium WebDriver waits until your application is ready before performing a certain step. There are several options that you can use to synchronize your test. Selenium RC has various waitFor methods; however, being a pure web automation API, Selenium WebDriver provides very limited methods for synchronization. In this chapter, you will see how to use the WebDriverWait
class to implement synchronization in tests.
Pop ups and Alerts
For building a great user interface, developers...