Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

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

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 65 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Using Selenium to Test Native Apps (Wait, you can do that?) (20)

Anzeige

Weitere von Sauce Labs (20)

Aktuellste (20)

Anzeige

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

  1. 1. Using Selenium to Test Native Applications …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 developer and 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 a field somewhere with no map, tools or supplies and being told you 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 Capture Framework 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 Source Can be extended
  44. 44. Uses webdriver API Runs with off-the-shelf client libraries Language agnostic
  45. 45. Real time Interact 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 App Appium 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 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()
  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. 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

×