Selenium Workbook #37: Reliable Client Booking Test

A complete, easy to read and maintain test script.

Courtney Zhan
4 min readMay 4, 2024

--

This article is one of the “Selenium Workbook” series, a set of bite-sized exercises. A practical and satisfying way to learn web test automation with Selenium WebDriver.

This is enhancement exercise of the previous two exercises, to create a production-quality automated test script for this core business scenario for WhenWise.

Learning Objectives

  • The concept of dynamic test data
    When a manual tester performs “Clicking on tomorrow’s date”, a dynamic test data, they can choose it without thinking. In test automation, we have to ‘think’ as ‘robots’,
    - Get today’s date
    - Get tomorrow’s date
    - Get the specific format of tomorrow’s date as required
  • Review
    - Using text() in XPath
    - Refactoring
  • Naming of Modal Page Class

Test Design

The steps are the same as before, mainly two enhancement tasks.

  1. Don’t use hard-coded tomorrow’s day, make it dynamic.
    It is common that we focus on getting test steps working at the first go, with some rough edges to be refine later. But be sure to do that after you get first successful run, which meant the core test steps are…

--

--