0

I am running automation code through selenium(latest version) / java(version-1.8.0_202") with Test NG . Browser : chrome (latest version) I am getting an issue like whenever I am running my test cases into local url / website runs on desktop version but same code I run through devops pipeline it takes the URL in other mode (for ex: tablet / ipad mini) as if it is not running in desktop mode.

How to restrict selenium code to run in virtual machine in desktop mode. (run in pipeline and it does not change the mode of the screen)

1 Answers1

0

You can set specific size of your browser window using the DesiredCapabilities class in Selenium

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("resolution", "1024x768");

Give the resolution that your current system has. You can check for system resolution from Start > Settings > System > Display in Win 10

demouser123
  • 4,108
  • 9
  • 50
  • 82