Choose locators and waits deliberately

Prefer stable element identifiers agreed with the application team. Long positional paths can break when layout changes without any business regression. Keep locator definitions close to their page interaction helpers so a changed interface can be repaired without editing every scenario that uses the page.

Use explicit waits for observable conditions such as a visible confirmation or an enabled submit button. Fixed sleeps waste time and still fail under slower execution. Selenium warns against mixing implicit and explicit waits because the resulting timeout behavior can be difficult to predict.

Keep page objects focused on interaction

A page object can expose actions such as entering an address or submitting a payment. Let the test describe the expected business result. Avoid helpers that swallow exceptions or silently retry every failed action, because they can hide a real interface problem from the reported result.

Start each scenario with known data and an independent browser session when the test requires isolation. Clean up created records through a reliable fixture. A previous scenario's login state or unfinished cart should not decide whether the next scenario can reach its intended starting point.

Diagnose failures before increasing timeouts

Capture the failing assertion, browser details, and relevant page state. Determine whether the application was slow, the locator was wrong, or the expected behavior changed. Increasing all timeouts may conceal an application performance regression while making every genuine failure take longer to report.

Run a small critical suite in continuous integration before expanding the browser matrix. Verify that failures remain readable when the browser runs remotely. Keep an owner for driver and browser compatibility so environment changes do not turn every delivery into an investigation of unrelated infrastructure.

Working sheet

Selenium reliability choices
ProblemPreferAvoid
Delayed confirmationWait for confirmation conditionFixed long sleep
Changing layoutStable agreed locatorPositional XPath chain
Shared login stateIndependent session fixtureOrdered test dependency
Hard diagnosisAssertion plus browser contextGeneric failure message
Download this worksheet (CSV)

Questions about build reliable Selenium test automation

Should implicit and explicit waits be combined?

Selenium advises against mixing them because timeout behavior can become unpredictable.

Does a page object replace assertions?

No. It organizes interactions. Tests still need explicit checks of expected behavior.

How should I use the working sheet?

Download the CSV and replace the sample rows with evidence from your repository. Record a clear acceptance check and an owner for each item. Keep unresolved assumptions visible rather than treating the example as a completed assessment.

Sources and further reading

Examples are illustrative. They are not customer results, security guarantees, or a substitute for checking the documentation for your installed version.

Make the next change verifiable.

Getzilla is an open source workflow for changes to existing repositories. Inspect the project, define acceptance checks, and keep independent review in the loop.

See the repository workflow See current access and pricing