Testing Native iOSApps with Appium
Dylan Lacey, Sauce Labs Inc.@DylanLacey
What is Appium?
+
Framework for Automating Browsers fortesting
Uses actual Browsers, ergo functions likea real user (mostly)
Can run locally or remotely
•
•
•
Selenium
Appium is a SeleniumServer for iOS
Native app controls are kinda webcontrols
Find things, click them, assert on content
Run your tests under automation
•
••
Rubyists Testing
iOS Testing
...Wat?
TEST
APPIUM
Selenium Instruments.js
You’re Lying. Show usCode
driver = Selenium::Webdriver.for( :remote, { :desired_capabilities => {:browserName => ‘iOS’, :platform => ‘Mac’, :version => ‘6.0’, :app => ABSOLUTE_APP_PATH}, :url => “http://127.0.0.1:4723/wd/hub” })
Example - Find, Values
require 'selenium-webdriver'include Selenium::WebDriver::DriverExtensions::HasInputDevicesinclude Selenium::WebDriver::DriverExtensions::HasTouchScreen
rows = driver.find_elements(:tag_name, "tableCell")rows[0].attribute(:name).should eq "Buttons, Various uses ofUIButton"
third_row = driver.find_elements(:tag_name, "tableCell")[2]third_row.location.y.should be 152
Example - [email protected]_elements(:tag_name, "tableCell")[9].click
@switch = @driver.find_element(:tag_name, "switch")@switch.displayed?.should be_true
@switch.attribute("value").should be [email protected]@switch.attribute("value").should be 1
@text_field = @driver.find_element(:tag_name, "textField")@text_field.send_keys("discombobulate")@text_field.attribute("value").should eq "discombobulate"
Example - Scrolling
row = @driver.find_elements(:tag_name, "tableCell")[2]initial_location = row.locationaction = @driver.touch.flick(0, 20)action.performinitial_location.should_not eq row.location
Demo
Host Remotely
Being a server, you can host tests onremote machines
Connect them to a Grid
Run them in parallel
Pay someone else to bother
•
•••
Gif because I feel leftout
Thanks for Listening;Have free sh... stuffAppium Site: Appium.io
Free Sauce Labs minutes: RailsConf13
PSST: Totally free for FOSS projects
Hit me up with Questions: @dylanlaceyor [email protected]
•••
•
Top Related