Chapter 5. Synchronizing Tests

In this chapter, we will cover the following:

  • Synchronizing a test with an implicit wait
  • Synchronizing a test with an explicit wait
  • Synchronizing a test with custom-expected conditions
  • Synchronizing a test with FluentWait

Introduction

While building automated scripts 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 ...

Get Selenium Testing Tools Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.