Mobile Testing with Selenium 2 by Jason Huggins
 

Mobile Testing with Selenium 2 by Jason Huggins

on

  • 16,921 views

See the slides from Jason Huggins' March 16 presentation at the San Francisco Selenium Meetup on using Selenium 2 for mobile testing.

See the slides from Jason Huggins' March 16 presentation at the San Francisco Selenium Meetup on using Selenium 2 for mobile testing.

Statistics

Views

Total Views
16,921
Views on SlideShare
16,914
Embed Views
7

Actions

Likes
9
Downloads
380
Comments
1

3 Embeds 7

http://www.scoop.it 4
http://a0.twimg.com 2
http://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Mobile Testing with Selenium 2 by Jason Huggins Mobile Testing with Selenium 2 by Jason Huggins Presentation Transcript

  • Selenium 2 Jason HugginsCo-creator, The Selenium ProjectCo-founder, CTO, Sauce Labs Inc twitter: @hugs email: hugs@saucelabs.com
  • Selenium 2: Why and What
  • Mobile
  • Types of Mobile Testing• Emulator• Real device (tethered to workstation)• Real device in a real location on a real network
  • Native vs Web
  • Life before the WebTotal Application Market
  • Yesterday JS+HTMLTotal Application Market
  • Today JS+HTML5Total Application Market
  • Data?
  • Sencha
  • SproutCore
  • PhoneGap
  • Today Selenium lives here! JS+HTML5Total Application Market
  • Today Selenium lives here! JS+HTML5Total Application Market
  • Tomorrow Selenium lives here! JS+HTML5Total Application Market
  • Mobile - How?
  • Checkout Selenium
  • Android
  • Download Android SDK
  • Unpack~/android_sdk
  • Update$ cd ~/android_sdk/tools$ ./android update sdk
  • Create AVD$ ./android create avd -n my_android -t 8 -c 100M
  • Start Emulator$ ./emulator -avd my_android -no-audio -no-boot-anim -scale .8 &
  • Install Selenium APK$ cd ~/android_sdk/platform-tools/$ ./adb -e install -r ~/selenium/android/prebuilt/android-server.apk
  • Port Forwarding$ ./adb forward tcp:8080 tcp:8080
  • Launch App$ adb -s shell am start -n org.openqa.selenium.android.app/ org.openqa.selenium.android.app.MainActivity
  • iPhone
  • Open in XCode$ open ~/selenium/iphone/iWebDriver.xcodeproj/
  • Build & Run
  • iphonesim
  • Demo!
  • 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()
  • 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()
  • Selenium 2 - The Movie http://www.youtube.com/watch?v=IUUcEIfkOEY
  • 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
  • One More Thing:
  • Thanks! Jason HugginsCo-creator, The Selenium ProjectCo-founder, CTO, Sauce Labs Inc twitter: @hugs email: hugs@saucelabs.com