Automation lab Aú Locators & Basic Actions (LOCATORS_BASIC)

Lab 005: Advanced locators (nth-child, text, data-testid)

Practice advanced locators (nth-child, text, data-testid) in a real web app context as part of the Locators & Basic Actions module.

basic basic
basic

Objectives

Use for test scripts
  • Understand the purpose and business flow of advanced locators (nth-child, text, data-testid).
  • Design stable locators for key UI elements.
  • Automate user interactions and verify the resulting UI state.

Sandbox

Locators & Basic Actions · web-ui · basic · active

Advanced locators nth-child text data-testId

Practice advanced locators nth-child text data-testId in a real web app context as part of the Locators & Basic Actions module.

Reading and understanding requirements Choosing stable locators Designing assertions based on business rules

Learning objectives

  • Understand the purpose and business flow of advanced locators nth-child text data-testId.
  • Design stable locators for key UI elements.
  • Automate user interactions and verify the resulting UI state.

Steps

  1. Open the lab page in the browser.
  2. Identify the key UI elements involved in this scenario.
  3. Describe the expected user flow for this scenario.
  4. Automate the steps of the flow using your chosen framework.
  5. Add assertions to validate the expected results.

Expected results

  • The business flow works end-to-end as expected.
  • All key UI elements behave according to the requirements.
  • Assertions clearly prove the behavior is correct.

Practice sandbox

Pick items using nth-child, text, and data-testId.

Live

List

  • Alpha
  • Bravo
  • Charlie
  • Delta

Actions

Waiting

Hints for automation

  • Use nth-child selectors to target second item.
  • Match text content to pick specific entry.
  • Prefer data-testId for stable locators.