Using Firefox

  1. Install modify-headers plug-in in Firefox.

  2. Create new ff profile

  3. Set appropriate user-agent in profile

To run using driver (not remote driver):

While running script pass additional system property -Dwebdriver.firefox.profile=<profilename> or in ant target add <systemproperty name="webdriver.firefox.profile" value="<profilename>">.

Set property

driver.name=firefoxDriver

To use remote driver

Start selenium server with -Dwebdriver.firefox.profile=<profilename>

Set properties

remote.server="selenium server host ip"
remote.port="port on which selenium server running"
driver.name=firefoxRemoteDriver

Using Chrome

  • Provide following property in application.properties file
chrome.additional.capabilities={"chromeOptions":{"mobileEmulation":{"deviceName":"Google Nexus 5"}}}
webdriver.chrome.driver = chromedriver path
driver.name=chromeDriver

Another way to run using Chrome :

  • Create Chrome Profile on which mobile web tests will execute.
  • Provide following property in application.properties file
chrome.additional.capabilities={"chromeOptions":{"args":["user-data-dir=D:/tools/webdriver/chromedriver_win32/mobile"]}}