Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Future of Selenium for mobile web and nativ...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Jason Carr
November 16, 2012
Technology
410
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
The Future of Selenium for mobile web and native apps
Jason Carr
November 16, 2012
More Decks by Jason Carr
See All by Jason Carr
Using Selenium to Test Native iOS Apps
maudineormsby
2
280
Other Decks in Technology
See All in Technology
「エンジニア進化論」2028年の開発完全自動化、エンジニアはどう進化するか
cyberagentdevelopers
PRO
5
4.5k
スキルと MCP ツール、責務をどう分けるか? AI が迷わないインターフェース設計の戦略
cdataj
1
950
日本 Fintech 未来予測レポート 2027〜2028年(手動編集版)
8maki
0
1.8k
自宅LLMの話
jacopen
1
260
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
680
How Timee Delivers Day 1 Production Ready LLM Features
tomoyks
0
130
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
130
連合学習と機密コンピューティング
lycorptech_jp
PRO
0
100
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
220
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
370
作って終わりにしない タイミーのセマンティックレイヤー育成の現在地
chanyou0311
4
2.2k
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
120
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.6k
Thoughts on Productivity
jonyablonski
76
5.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.1k
GitHub's CSS Performance
jonrohan
1033
470k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
330
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
610
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
ラッコキーワード サービス紹介資料
rakko
1
3.6M
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Transcript
The future of Selenium testing for mobile web and native
apps
Hi. I’m JASON CARR. I work at sauce LABS.
@maudineormsby
None
I’m a developer and contributor to SELENIUM and APPIUM
Context
For mobile web, Web Driver
Script Script Selenium Grid (optional) Selenium Grid (optional) iWebDriver.app
Script Script iWebDriver.app
iWebDriver.app from selenium import webdriver hub = ‘http://localhost:3001/wd/hub’ caps =
webdriver.DesiredCapabilities.IPHONE driver = webdriver.Remote(hub, caps) from selenium import webdriver hub = ‘http://localhost:3001/wd/hub’ caps = webdriver.DesiredCapabilities.IPHONE driver = webdriver.Remote(hub, caps)
None
Limitations
iframes
driver.quit()
Alert handling
Javascript
UIAutomation
“…a bit like being dropped off in a field somewhere
with no map, tools or supplies and being told you need to build a house.” -Alex Vollmer
js js Instruments.app Instruments.app App
js js Instruments.app Instruments.app App CLIENT DEVICE
UI Automation only runs in Instruments.app
Tests have to be in Javascript
No realtime interaction with tests
Hard to reuse code
One test at a time
An aside: Android automation…
Monkey Runner
So what have we LEARNED SO FAR?
Two attempted approaches to automation
Script/ Framework Script/ Framework Screen Capture Screen Capture App CLIENT
DEVICE
Hard to abstract
Very brittle
Hard to use with real devices
Hard to use with CI or parallelize
script script Client library Client library App CLIENT DEVICE
Requires code modification
Real devices are hard
New framework and new tests
The RIGHT WAY TO AUTOMATE IOS
Remember the testing pyramid
None
Are you writing unit tests for apps? It’s not that
hard!
Test your views appropriately
For UIWebViews use iWebDriver
Yes, yes, but NOW WHAT?
Code reuse is good.
Realtime interaction
Integrate with existing automation
Parallel tests and real devices
That sounds great, BUT HOW?
APPIUM
Open Source Can be extended
Uses webdriver API Runs with off-the-shelf client libraries Language agnostic
Real time Interact with js interpreter or client
Real devices
Works in parallel (architecturally)
No code modification
test script test script Instruments.app Instruments.app App CLIENT DEVICE Appium
Server Appium Server
Easy to get started
Clone Appium
pip install bottle
python server.py /path/to/my.app
from selenium import webdriver command_url = “http://localhost:4723/wd/hub” iphone = webdriver.DesiredCapabilities.IPHONE
driver = webdriver.Remote(command_url, iphone) fields = driver.find_elements_by_tag_name('textField’) fields[0].send_keys(3) fields[1].send_keys(4) buttons = driver.find_elements_by_tag_name('button’) buttons[0].click()
DEMO
Doesn’t support execute_script() …yet. More on this later.
1 Second delay between commands UI Automation limitation
Still uses UIAutomation ‘Accessibility’ is important
WHERE DO WE GO FROM HERE?
WebKit remote debugging protocol
Drive mobile safari
Drive desktop safari
Drive chrome on android!
Android RC
Questions? Thank you!
Resources Appium Github Repo: http://goo.gl/4E5F0 Dan Cuellar’s talk on Appium:
http://goo.gl/qgLha François Reynaud on ios-driver: http://goo.gl/pzn75 Simon Stewart’s blog on mobile testing: http://goo.gl/8wl8j