I am using selenium webdriver for functional test automation of AUT (Application Under Test). AUT is responsive web and i am almost done with different test case for desktop browser.
Now the same test cases are applicable for mobile browser as well because the AUT can be accessed from mobile browser. As it is responsive web when we open in mobile browser the UI has some different representation. So we need to run those test for mobile browsers as well. For manual testing team using safari browser's user agent feature
Safari Browser menu - > Develop -> User Agent
and it satisfies our need for manual testing.
If we can do the similar thing with automation, i.e. running test on desktop browser with some twik, then it is also accepted to considered as mobile web automation done. My question is how can i do the same thing like modify header, while using web driver. The url is the same because there is only one web app.
My automated test are working fine on firefox using FirefoxDriver and chromeDriver. Both browser has similar development tools available but i am not able to utilise it through automation.
We are using selenium 2.53.0. Our IVY file has following dependencies related to selenium.
<dependency org="org.seleniumhq.selenium" name="selenium-remote-driver" rev="2.53.0"/>
<dependency org="org.seleniumhq.selenium" name="selenium-java" rev="2.53.0"/>
Can anybody provide suggestions and help that how can i run my test to achieve it and what are the related code changes i need to do?
Thanks.
Google Chrome provides a mechanism for emulating mobile devices when you instantiate the driver, see the full docs here.
Example: