Selenium Workbook #38: Verify Available Time Slots

Extract the texts from multiple same-styled button texts.

Courtney Zhan
4 min readMay 12, 2024

--

This article is one of the “Web Test Automation Workbook” series, a set of bite-sized exercises (typically 15–20 mins). A practical and satisfying way to learn web test automation with Selenium WebDriver.

In the last exercise, we completed one automated test script for the core business scenario. Typcially after that, we will develop automated tests for alternative business workflows or checks around that. Today’s exercise is an example.

Learning Objectives

  • Extract the text from multiple same-styled button texts.
  • Review
    - find_elements
    - List: assertion
    - List: collect to extract another list from the original List

Test Design

  1. Navigate to the business booking page, which we have done many times in previous exercises.
  2. Click tomorrow’s date
  3. Extract the available time slots, e.g. 9:00, 10:00, …, etc, and do an assertion.
    (we stop here for this article, see the next article for the rest of the test steps)

Essentially, apart from the test steps from the previous exercise, there is really just one assertion step to be done…

--

--