Skip to main content
SeleniumDecoded
Back to Practice

Coding Challenges

Debug, fix, and write Selenium code in real-world scenarios

beginner 10 min

Replace Brittle Locators

A checkout test uses absolute XPath and styling classes copied from DevTools. Rewrite the locators so a redesign will not break them.

#locators #xpath #css #data-testid #maintenance
Start Challenge
advanced 15 min

Catch the JavaScript Error the Test Missed

A checkout test passes while the page throws an uncaught TypeError. Use WebDriver BiDi to make the test fail on JavaScript errors.

#bidi #console #javascript-errors #quality
Start Challenge
beginner 10 min

The Dropdown That Is Not a Select

The Select helper throws UnexpectedTagNameException on a styled dropdown. Drive the custom widget correctly.

#dropdown #select #custom-widget #actions
Start Challenge
beginner 10 min

Fix the Flaky Login Test

A login test passes locally and fails one run in five on CI. Remove the sleeps and make it deterministic.

#waits #flaky #sleep #explicit-waits
Start Challenge
intermediate 20 min

Extract a Page Object

Three tests repeat the same login steps with inline locators. Extract a LoginPage that hides locators and waits.

#page-object-model #refactoring #architecture
Start Challenge
intermediate 10 min

The Payment iFrame Bug

After entering a card number inside the payment iframe, the test cannot find the Pay button. Find and fix the context bug.

#iframe #switch #context #payment
Start Challenge
intermediate 10 min

The 30-Second Negative Check

Asserting that an error is not shown takes 30 seconds every time. Diagnose the wait configuration and fix it.

#implicit-wait #explicit-wait #find-elements #performance
Start Challenge
intermediate 10 min

The Wrong Tab

A test that opens a help link in a new tab sometimes asserts against the original tab. Fix the handle logic.

#windows #tabs #handles #race
Start Challenge
intermediate 15 min

Stale Elements in a Delete Loop

Deleting every row in a table throws StaleElementReferenceException after the first deletion. Make the loop robust.

#stale-element #loops #dom #re-find
Start Challenge
advanced 20 min

Tests Interfere When Run in Parallel

A suite passes serially and fails chaotically with parallel threads. Find the shared state and isolate each test's driver.

#parallel #thread-local #driver-factory #testng
Start Challenge