Created
April 3, 2012 23:45
-
-
Save dariodiaz/2296411 to your computer and use it in GitHub Desktop.
webdriver: Mobile user agent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------------------------------ | |
# Define Caps | |
#------------------------------------------------------------------------------------------------------ | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile['general.useragent.override'] = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16" | |
if platform.match(/Firefox/) | |
caps = Selenium::WebDriver::Remote::Capabilities.firefox(:javascript_enabled => true, :firefox_profile=> profile) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment