Your SlideShare is downloading. ×
0
Using Selenium to Test NativeApplications           …wait, you can do that?
Hi.I’m JASON CARR. I work at sauce            LABS.
@maudineormsby  …it’s a long story.
I’m a developerand contributor to selenium and appium
This talk is about…
This talk is about…the problem of ios app automation
This talk is about…lessons learned automating apps
This talk is about…the right approach to testing native apps
This talk is about…the tools available to test your apps today
This talk is about…WHAT HOPE WE HAVE FOR THE FUTURE.
the problem of ios app automation
“…a bit like being dropped off in afield somewhere with no map,tools or supplies and being toldyou need to build a house.”...
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
So what have we learned so far?
Two attempted approaches to        automation
Script/    Script/                           App                  Screen Capture                   Screen CaptureFramework...
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
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 SourceCan be extended
Uses webdriver APIRuns with off-the-shelf client          libraries     Language agnostic
Real timeInteract with js interpreter or client
Real devices
Works in parallel  (architecturally)
No code modification
test script   test script                                          AppAppium Server Appium Server       Instruments.app   ...
Easy to get started
Clone Appium
pip install bottle
python server.py /path/to/my.app
from selenium import webdrivercommand_url = “http://localhost:4723/wd/hub”iphone = webdriver.DesiredCapabilities.IPHONEdri...
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?
Implement more of the API
WebKit remote debugging protocol
Selenium Grid support
Questions? Thank you!
ResourcesAppium Github Repo:http://goo.gl/4E5F0Dan Cuellar’s talk on Appium:http://goo.gl/qgLhaFrançois Reynaud on ios-dri...
Using Selenium to Test Native Apps (Wait, you can do that?)
Upcoming SlideShare
Loading in...5
×

Using Selenium to Test Native Apps (Wait, you can do that?)

8,940

Published on

Published in: Technology
0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
8,940
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
131
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide

Transcript of "Using Selenium to Test Native Apps (Wait, you can do that?)"

  1. 1. Using Selenium to Test NativeApplications …wait, you can do that?
  2. 2. Hi.I’m JASON CARR. I work at sauce LABS.
  3. 3. @maudineormsby …it’s a long story.
  4. 4. I’m a developerand contributor to selenium and appium
  5. 5. This talk is about…
  6. 6. This talk is about…the problem of ios app automation
  7. 7. This talk is about…lessons learned automating apps
  8. 8. This talk is about…the right approach to testing native apps
  9. 9. This talk is about…the tools available to test your apps today
  10. 10. This talk is about…WHAT HOPE WE HAVE FOR THE FUTURE.
  11. 11. the problem of ios app automation
  12. 12. “…a bit like being dropped off in afield somewhere with no map,tools or supplies and being toldyou need to build a house.” -Alex Vollmer
  13. 13. js js Instruments.app Instruments.app App
  14. 14. js js Instruments.app Instruments.app App client device
  15. 15. UI Automation only runs in Instruments.app
  16. 16. Tests have to be in Javascript
  17. 17. No realtime interaction with tests
  18. 18. Hard to reuse code
  19. 19. One test at a time
  20. 20. So what have we learned so far?
  21. 21. Two attempted approaches to automation
  22. 22. Script/ Script/ App Screen Capture Screen CaptureFramework Framework client device
  23. 23. Hard to abstract
  24. 24. Very brittle
  25. 25. Hard to use with real devices
  26. 26. Hard to use with CI or parallelize
  27. 27. script script Client library Client library App client device
  28. 28. Requires code modification
  29. 29. Real devices are hard
  30. 30. New framework and new tests
  31. 31. The right way to automate ios
  32. 32. Remember the testing pyramid
  33. 33. Are you writing unit tests for apps? It’s not that hard!
  34. 34. Test your views appropriately
  35. 35. For UIWebViews use iWebDriver
  36. 36. Yes, yes, but now what?
  37. 37. Code reuse is good.
  38. 38. Realtime interaction
  39. 39. Integrate with existing automation
  40. 40. Parallel tests and real devices
  41. 41. That sounds great, but how?
  42. 42. Appium
  43. 43. Open SourceCan be extended
  44. 44. Uses webdriver APIRuns with off-the-shelf client libraries Language agnostic
  45. 45. Real timeInteract with js interpreter or client
  46. 46. Real devices
  47. 47. Works in parallel (architecturally)
  48. 48. No code modification
  49. 49. test script test script AppAppium Server Appium Server Instruments.app Instruments.app client device
  50. 50. Easy to get started
  51. 51. Clone Appium
  52. 52. pip install bottle
  53. 53. python server.py /path/to/my.app
  54. 54. from selenium import webdrivercommand_url = “http://localhost:4723/wd/hub”iphone = webdriver.DesiredCapabilities.IPHONEdriver = 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()
  55. 55. demo
  56. 56. Doesn’t support execute_script() …yet. More on this later.
  57. 57. 1 Second delay between commands UI Automation limitation
  58. 58. Still uses UIAutomation ‘Accessibility’ is important
  59. 59. where do we go from here?
  60. 60. Implement more of the API
  61. 61. WebKit remote debugging protocol
  62. 62. Selenium Grid support
  63. 63. Questions? Thank you!
  64. 64. ResourcesAppium Github Repo:http://goo.gl/4E5F0Dan Cuellar’s talk on Appium:http://goo.gl/qgLhaFrançois Reynaud on ios-driver:http://goo.gl/pzn75Simon Stewart’s blog on mobiletesting:http://goo.gl/8wl8j
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×