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

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"

Using Chrome

  • Provide following property in file
chrome.additional.capabilities={"chromeOptions":{"mobileEmulation":{"deviceName":"Google Nexus 5"}}} = chromedriver path

Another way to run using Chrome :

  • Create Chrome Profile on which mobile web tests will execute.
  • Provide following property in file