$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Make your Browsers work for You
Search
Jev Zelenkov
May 14, 2014
Programming
0
77
Make your Browsers work for You
Learn about Selenium WebDriver and get excited by beautiful & concise E2E tests
Jev Zelenkov
May 14, 2014
Tweet
Share
More Decks by Jev Zelenkov
See All by Jev Zelenkov
Prototypical inheritance in ECMAScript 6
jevzee
0
90
Other Decks in Programming
See All in Programming
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
640
Developing static sites with Ruby
okuramasafumi
0
240
20 years of Symfony, what's next?
fabpot
2
340
開発に寄りそう自動テストの実現
goyoki
1
750
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.2k
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
6
1.2k
CSC305 Lecture 17
javiergs
PRO
0
340
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
18
7.2k
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
11
11k
ソフトウェア設計の課題・原則・実践技法
masuda220
PRO
26
22k
AIコーディングエージェント(NotebookLM)
kondai24
0
170
Go コードベースの構成と AI コンテキスト定義
andpad
0
120
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
For a Future-Friendly Web
brad_frost
180
10k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
We Have a Design System, Now What?
morganepeng
54
7.9k
Building Applications with DynamoDB
mza
96
6.8k
Agile that works and the tools we love
rasmusluckow
331
21k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
The Cost Of JavaScript in 2023
addyosmani
55
9.3k
Transcript
E2E testing with WebDriver API @jzelenkov FrankfurtJS #2 14 May
2014 Make your Browsers work for You
Do you write any front end tests?
complexity
changes
unit testing
(another) end from (one) end 2 http://david.heinemeierhansson.com/2014/tdd-is-dead-long-live-testing.html
Browsers
real
SlimerJS* PhantomJS headless * SlimerJS is not a fully headless
browser yet
ZombieJS unreal
or WebDriver ? Selenium
Selenium WebDriver* * Selenium RC
Selenium WebDriver* * Selenium RC epic naming #1
e2e test browser(s) selenium server API 1 1 WebDriver JSON
Wire Protocol Selenium WebDriver 2 Standalone Driver 3 Extension Driver 2 3 2
Selenium WebDriver JS Wrapper npm: selenium-webdriver
driver.get(‘http://...’); driver.findElement(webdriver.By.name('whoami')) .sendKeys('FrankfurtJS!'); driver.findElement(webdriver.By.id('greet')) .click(); driver.findElement(webdriver.By.id('message')) .getText() .then(function(val) { assert.equal(val,
'FrankfurtJS!'); }); SWD WebDriverJS
Alternatives
WebDriverJS http://webdriver.io @webdriverjs npm: webdriverjs
WebDriverJS http://webdriver.io @webdriverjs npm: webdriverjs epic naming #2
client .init() .url(‘http://...’) .addValue('[name="whoami"]', 'FrankfurtJS!') .buttonClick('#greet') .getText('#message', function(err, text) {
assert.equal(text, 'FrankfurtJS!'); }) WebDriverJS
DalekJS http://dalekjs.com @dalekjs npm: dalekjs
test .open('http://...') .type('[name="whoami"]', 'FrankfurtJS!') .click('#greet') .assert.text('#message').is('FrankfurtJS!') .done(); DalekJS
Protractor https://github.com/angular/protractor @ ProtractorTest npm: protractor
browser.ignoreSynchronization = true; ! browser.get(‘http://...'); element(by.name('whoami')).sendKeys('FrankfurtJS!'); element(by.id('greet')).click(); element(by.id(‘message')) .getText() .then(function(val){
assert.equal(val, 'FrankfurtJS!'); }); Protractor
others npm: selenium-test-runner npm: wd . . . npm: wd-sync
npm: yiewd . . . . . .
Selenium WebDriver Issues browser support frontend code
end 2 end for the win recap
thank you!
this presentation: https://speakerdeck.com/jzelenkov source code: http://bit.ly/1sNtUVL