how to run selenium tests on android and ios
TRANSCRIPT
Today we will cover
1. What is Selenium?2. How to test on Android3. How to test on iOS4. Q/A Session
Introduction
Supported by all major browser vendors:
What is Selenium?
Free and open source browser automation framework.
What is Selenium?
How does it work?
Your Code
What is Selenium?
How does it work?
Your Code Selenium
What is Selenium?
How does it work?
Your Code Selenium
AndroidDriver
iOSDriver
Selenium language bindings are available for:
• Java• C#• Ruby• Python• JavaScript• Perl (third-party)• PHP (third-party)
What is Selenium?
Which programming languages are supported?
• Install Java: https://www.java.com/en/download/• Install Android Studio: https://developer.android.com/studio/index.html• Install SDK + Build tools with SDK Manager• Create an Emulator / Device• Download the driver: http://selendroid.io/• Start driver: java -jar selendroid-standalone-0.17.0-with-dependencies.jar
Setup Android
Requirements
A Simple Test
from selenium import webdriverfrom selenium.webdriver.common.keys import Keysfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilitiesimport time
driver = webdriver.Remote(desired_capabilities=DesiredCapabilities.ANDROID)driver.get("http://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys("Selenium")
elem.submit()
time.sleep(5)
driver.quit()
Run on Android
Demo
• Install Xcode from the AppStore• Start Xcode at least once (otherwise it will fail to start the emulator)• Install Java• Download the driver: https://ios-driver.github.io/ios-driver/• Start driver: java -jar ios-server-standalone-0.6.6-SNAPSHOT.jar• Modify iPhone Emulator (Terminal)$xcodeVersion=`xcode-select --print-path`$sudo chmod a+rw "$xcodeVersion/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Applications„$sudo chmod -R a+rw "$xcodeVersion/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.0.sdk/Applications/MobileSafari.app"
Setup iOS
Requirements
A Simple Test
from selenium import webdriverfrom selenium.webdriver.common.keys import Keysfrom selenium.webdriver.common.desired_capabilities import DesiredCapabilitiesimport time
driver = webdriver.Remote(desired_capabilities=DesiredCapabilities.IPHONE)driver.get("http://www.google.com")
elem = driver.find_element_by_name("q")
elem.send_keys("Selenium")
elem.submit()
time.sleep(5)
driver.quit()
Run on iOS
Demo
Questions?
Q & A