Saturday, February 1, 2014

Opera Mobile Emulator testing with Selenium WebDriver

Opera Mobile Emulator
OperaDriver has recently been updated to support running Selenium tests on the Opera Mobile Emulator.
The update will land in Selenium 2.26, but we couldn’t wait and decided to already add it to our Selenium Grid.
By specifying some desired capabilities, you can run your tests on a specific emulated device.
You can change the resolution of the screen, the pixel density and the UI.
Here’s an example where we run a test on the tablet UI with a 800×600 display:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
caps = {
  :browserName => "operea",
  :platform => "LINUX",
  'opera.product' => 'mobile',
  'opera.arguments => '-tabletui -displaysize 860x600'
}
 
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 120
@webdriver = Selenium::WebDriver.for :remote,:url => urlhub , :desired_capabilities => caps,:http_client => client
@webdriver.navigate.to "http://testingbot.com"
puts @webdriver.title
@webdriver.quit
Right now Opera Mobile support is still robust and in need for some (minor) tweaks, but we think it’s starting to look good.


No comments:

Post a Comment