Selenium WebDriver: your first small suite
Selenium drives a real browser from code. Write a first script, add waits and locators, and keep it tidy so a small suite can grow.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: a remote-control car. A remote-control car does what the driver commands: forward, turn, stop. The driver looks at the car and decides the next move.
If the driver sends commands faster than the car moves, the car misses its turn. A good driver waits until the car reaches the corner.
is a remote control for a browser. The script sends commands and reads what the browser shows. Tom, the tester at Daily List, a to-do list app, learns to wait for the page, not guess how long it needs.
PLAIN WORDS · 1 in this section
- selenium
- A free tool that drives a web browser for checks.
PICTURE IT
The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.
THE REAL JOB Driving a real browser from code, like a remote-control car that needs the driver to wait for the corner.
- Find
- Wait
- Act
- Quit
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The remote control | The WebDriver script |
| The car | The browser |
| Waiting for the corner | An explicit wait |
| A label on each button | A locator |
WHERE THIS PICTURE STOPS
- A car moves in the open, but a page changes under the script.
- A driver sees the car, but a script sees only what it reads.
- A car stops when the driver stops, but a browser stays open until quit.
HOOK
Command, wait, check, quit.
TELL A FRIEND
A remote-control car: send a command, wait for the corner, check, then stop.
OFTEN MIXED UP WITH Reading a driver's commands: navigate, ask, act. That topic names the basic WebDriver commands. This one puts them in a first working script and a small suite.
PRACTISE AND KEEP
Sources for this topic — 3 sources
- Market practice
Write your first Selenium script (Selenium documentation) ↗ — Selenium project · Selenium documentation: the first script starts a driver, goes to a page, sets a wait, finds elements and ends the session with quit, which also closes the browser by default (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Locator strategies (Selenium documentation) ↗ — Selenium project · Selenium documentation: WebDriver supports traditional location strategies including id, name, CSS selector, XPath, link text and tag name (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
- Market practice
Waiting strategies (Selenium documentation) ↗ — Selenium project · Selenium documentation: explicit waits poll for a condition, because the browser and the page are often out of step when a command runs (search excerpt, page not opened)
Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.
Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.