Skip to main content
2 of 2
added 10 characters in body
IAmMilinPatel
  • 7.8k
  • 7
  • 43
  • 68

Not sure why that would happen in Windows 10 (same thing works for me).

Couple of things you could try depending on what you need:

  1. Add width and height options to the Firefox initialisation set to the screen resolution you need it to open as.
  2. Also run it headless with those dimensions set (as do you need to see the browser if it's running in the background?)
System.setProperty("webdriver.gecko.driver", locationFirefoxDriver);
FirefoxBinary firefoxBinary = new FirefoxBinary();
firefoxBinary.addCommandLineOptions("--headless");
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.addArguments("--width=1920");
firefoxOptions.addArguments("--height=1080");
firefoxOptions.setBinary(firefoxBinary);
driver = new FirefoxDriver(firefoxOptions);

Although I can understand not bothering with Headless and Firefox. With Chrome you get about 30% speed improvement. Firefox, I'm not sure it's even 3%.

Klynt
  • 544
  • 2
  • 9