Selenium WebDriver 4

Design a fluent page API

Expert190 pts~70 min
  • Fluent interfaces
  • Page Object Model
Practice app · Acme Ops

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

Test URL
/lab/selenium-design-a-fluent-page-api

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

Objective

Design page methods that return the page itself so a sign-in reads as one fluent chain.

Your task

  1. 1Give LoginPage chainable methods open(), enterEmail(text), enterPassword(text) that return this/self.
  2. 2submit() clicks #login-button and returns a DashboardPage.
  3. 3Write the flow as one chain: open().enterEmail("qa@target.dev").enterPassword("Test@123").submit().
  4. 4Assert the welcome message on the returned DashboardPage.

Acceptance criteria

  • Methods return this/self and are chained
  • The dashboard is shown with the welcome message
  • At least 1 assertion passes

Fixtures

username
qa@target.dev
password
Test@123

Selenium WebDriver 4 · Selenium · Page Object Model & architecture