119 / 168 · 01 Agent Skills for Browser Automation · Evolution: From Selenium to WebDriver BiDi← prev⊞ allnext →☰ Read as one page
16.3Era 2: WebDriver and Native Browser APIs (2011-2017)
How It Worked
Each browser vendor provided a "driver" binary (chromedriver, geckodriver) that used native browser APIs to control the browser. Communication was HTTP + JSON.
Test Script ──HTTP──► ChromeDriver ──Native API──► Chrome
The WebDriver Protocol (W3C Standard, 2018)
POST /session → Create session
POST /session/{id}/url → Navigate
POST /session/{id}/element → Find element
POST /session/{id}/element/{id}/click → Click element
POST /session/{id}/element/{id}/value → Type text
GET /session/{id}/screenshot → Take screenshot
DELETE /session/{id} → Close session
Advantages Over Selenium 1
- Native control: No JavaScript injection needed
- Cross-domain: No same-origin restrictions
- Standardized: W3C standard, all browsers implement it
- Reliable: Using browser's own APIs
Limitations
- Unidirectional: Client asks, browser answers. No events.
- Coarse-grained: Limited to what the spec defines
- No real-time: Can't listen for console logs, network events, etc.
- Polling required: To detect page changes, must repeatedly ask