Mobile Testing


Our grid currently supports iPhone (iOS 6.1 and 7.1), Android 4.4 and iPad (iOS 6.1 and 7.1).

Testing on mobile devices is only available with the WebDriver protocol.



Appium: test native and hybrid iOS apps

Appium

With the new Appium support on our grid, you can now test your native and hybrid iOS apps in our cloud.


Mobile optional desired capabilities

To run a test in landscape mode, please use the orientation webdriver command.


Below are some examples on how to test on mobile.



iPhone / iPad example:
Iphone example small
#!/usr/bin/env ruby
require "rubygems"
gem "selenium-client"
gem "selenium-webdriver"
require "selenium-webdriver"
require "selenium/client"


caps = {
  :browserName => "iphone", #or iPad
  :version => "7.1",
  :platform => "MAC"
}

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 480

driver = Selenium::WebDriver.for(
  :remote,
  :url => "http://API_KEY:API_SECRET@hub.testingbot.com:4444/wd/hub",
  :http_client => client,
  :desired_capabilities => caps)
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit
puts driver.title
driver.quit
		


Opera Mobile Emulator:
Opera mobile small
#!/usr/bin/env ruby
require "rubygems"
gem "selenium-client"
gem "selenium-webdriver"
require "selenium-webdriver"
require "selenium/client"


caps = {
	:browserName => "opera",
	:platform => "LINUX",
	'opera.product' => 'mobile',
	'opera.arguments' => '-tabletui -displaysize 860x600'
}

client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 480

driver = Selenium::WebDriver.for(
  :remote,
  :url => "http://API_KEY:API_SECRET@hub.testingbot.com:4444/wd/hub",
  :http_client => client,
  :desired_capabilities => caps)
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit
puts driver.title
driver.quit
		
You can find more info on the OperaDriver page.