Replace login locators with the dashboard outcome
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
def test_account_dashboard_access():
driver = webdriver.Chrome()
try:
wait = WebDriverWait(driver, float(os.environ["WAIT_SECONDS"]))
base_url = os.environ["BASE_URL"].rstrip("/")
driver.get(base_url + "/login")
wait.until(EC.element_to_be_clickable((By.NAME, "email"))).send_keys(os.environ["QA_EMAIL"])
wait.until(EC.element_to_be_clickable((By.NAME, "password"))).send_keys(os.environ["QA_PASSWORD"])
wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, "button[type='submit']"))).click()
wait.until(EC.url_to_be(base_url + "/dashboard"))
wait.until(EC.visibility_of_element_located((By.ID, "account-menu")))
wait.until(EC.visibility_of_element_located((By.XPATH, "//h2[normalize-space()='Recent activity']")))
assert not driver.find_elements(By.CSS_SELECTOR, "[role='alert'].login-error")
finally:
driver.quit()Illustrative Selenium 4 Python test for pytest. Supply BASE_URL, WAIT_SECONDS, QA_EMAIL and QA_PASSWORD. The account uses password login without an authenticator challenge; the app removes the login error element on success. The test creates a fresh browser and leaves implicit waits unset. Source 1 · checked 2026-10-23. Source 2 · checked 2026-10-23. Source 3 · checked 2026-10-23. Source 4 · checked 2026-10-23.
Name: Account dashboard access Starting path: /login Environment: Staging Instructions: Sign in with the saved QA login and open the account dashboard. Expected: The account menu and recent activity are visible. A sign-in error or unresolved login challenge does not pass.
Save the account as an environment login instead of pasting credentials into What to test. When the sign-in challenge itself is under test, select Start logged out under Options, or leave Reuse login sessions off on the login. Session reuse is off by default. If your actual flow uses an authenticator, save its setup key and include that challenge in the scenario. The benchmark below did not complete sign-in.
The run ended with an Error status, which our benchmark scores as cannot verify: the security check failed and no credentials were supplied. It illustrates an unresolved login prerequisite, not a successful sign-in or proof that your authentication will work.