Selenium WebDriver 4

Execute tests on a Selenium Grid

Expert190 pts~70 min
  • Selenium Grid
  • RemoteWebDriver
  • Capabilities
Practice app · Acme Ops

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

Test URL
/lab/qa-automation-execute-tests-on-a-selenium-grid

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

Objective

Create the driver through a Selenium Grid endpoint taken from the environment, with a local fallback.

Your task

  1. 1Read the Grid URL from SELENIUM_REMOTE_URL (for example http://localhost:4444).
  2. 2When it is set, create RemoteWebDriver / webdriver.Remote / new Builder().usingServer(url) with ChromeOptions.
  3. 3Otherwise fall back to a local Chrome driver.
  4. 4Sign in with qa@target.dev / Test@123 (#username, #password, #login-button). Assert the dashboard and log the session's browserName capability.

Acceptance criteria

  • A remote driver is created from an environment-provided URL
  • The dashboard is shown
  • At least 1 assertion passes

Constraints

  • The suite must still pass on the practice runner: fall back to a local Chrome driver when the environment variable is not set.

Fixtures

username
qa@target.dev
password
Test@123

Selenium WebDriver 4 · QA Automation · Grid, parallel & CI