Your SlideShare is downloading. ×
0
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
selenium-2-mobile-web-testing
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

selenium-2-mobile-web-testing

14,830

Published on

How to test mobile web applications with Selenium 2.

How to test mobile web applications with Selenium 2.

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

No Downloads
Views
Total Views
14,830
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
430
Comments
0
Likes
14
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Testing the Mobile Web with Selenium 2 Jason Huggins Co-creator, The Selenium Project Co-founder, CTO, Sauce Labs Inc twitter: @hugs email: hugs@saucelabs.com
  • 2. Selenium 2: Why and What
  • 3. Mobile
  • 4. Types of Mobile Testing• Emulator• Real device (tethered to workstation)• Real device in a real location on a real network
  • 5. Native vs Web
  • 6. Life before the WebTotal Application Market
  • 7. Yesterday JS+HTMLTotal Application Market
  • 8. Today JS+HTML5Total Application Market
  • 9. Data?
  • 10. Sencha
  • 11. SproutCore
  • 12. PhoneGap
  • 13. Today Selenium lives here! JS+HTML5Total Application Market
  • 14. Today Selenium lives here! JS+HTML5Total Application Market
  • 15. Tomorrow Selenium lives here! JS+HTML5Total Application Market
  • 16. Mobile - How?
  • 17. Checkout Selenium
  • 18. Android
  • 19. Download Android SDK
  • 20. Unpack~/android_sdk
  • 21. Update$ cd ~/android_sdk/tools$ ./android update sdk
  • 22. Create AVD$ ./android create avd -n my_android -t 8 -c 100M
  • 23. Start Emulator$ ./emulator -avd my_android -no-audio -no-boot-anim -scale .8
  • 24. Install Selenium APK$ cd ~/android_sdk/platform-tools/$ ./adb -e install -r ~/selenium/android/prebuilt/android-server.apk
  • 25. Port Forwarding$ ./adb forward tcp:8080 tcp:8080
  • 26. Launch App$ adb -s shell am start -n org.openqa.selenium.android.app/ org.openqa.selenium.android.app.MainActivity
  • 27. iPhone
  • 28. Open in XCode$ open ~/selenium/iphone/iWebDriver.xcodeproj/
  • 29. Build & Run
  • 30. iphonesim
  • 31. Demo!
  • 32. Selenium 2 - The Movie http://www.youtube.com/watch?v=IUUcEIfkOEY
  • 33. The Code:# Import the Selenium 2 namespace (aka "webdriver")from selenium import webdriver# Run one of the four following commands:# iPhonedriver = webdriver.Remote(browser_name="iphone", command_executor=http://172.24.101.36:3001/hub)# Androiddriver = webdriver.Remote(browser_name="android", command_executor=http://127.0.0.1:8080/hub)# Google Chromedriver = webdriver.Chrome()# Firefoxdriver = webdriver.Firefox()
  • 34. The Code:# The actual test scenario: Test the codepad.org code execution service.# Go to codepad.orgdriver.get(http://codepad.org)# Select the Python language optionpython_link = driver.find_elements_by_xpath("//input[@name=lang and @value=Python]")[0]python_link.click()# Enter some text!text_area = driver.find_element_by_id(textarea)text_area.send_keys("print Hello, + World!")# Submit the form!submit_button = driver.find_element_by_name(submit)submit_button.click()# Make this an actual test. Isnt Python beautiful?assert "Hello, World!" in driver.get_page_source()# Close the browser!driver.quit()
  • 35. LinksFor More Information:✓http://seleniumhq.org✓http://code.google.com/p/selenium✓http://saucelabs.com/docs/selenium2✓http://twitter.com/hugsDemo Screencast:✓http://www.youtube.com/watch?v=IUUcEIfkOEYCode:✓http://gist.github.com/830011
  • 36. One More Thing:
  • 37. Thanks! Jason HugginsCo-creator, The Selenium ProjectCo-founder, CTO, Sauce Labs Inc twitter: @hugs email: hugs@saucelabs.com

×