Selenium WebDriver 4

Build a reusable base page

Hard120 pts~45 min
  • Page Object Model
  • Inheritance
  • Reuse
Practice app · Acme Ops

A sign-in page with field validation and an authenticated dashboard.

Test URL
/lab/selenium-build-a-reusable-base-page

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Extract shared driver, wait and interaction helpers into a base page that concrete pages inherit.

Your task

  1. 1Create BasePage holding the driver and a WebDriverWait, with helpers such as find, click, type and textOf that wait first.
  2. 2Make LoginPage and DashboardPage extend BasePage.
  3. 3Sign in with qa@target.dev / Test@123 (#username, #password, #login-button).
  4. 4Assert #user-role reads “Administrator” via a DashboardPage method.

Acceptance criteria

  • A BasePage class exists and pages inherit from it
  • #user-role shows “Administrator”
  • At least 1 assertion passes

Fixtures

username
qa@target.dev
password
Test@123

Selenium WebDriver 4 · Selenium · Page Object Model & architecture