0

In selenium using driver.manage().window().maximize(); the command I Maximize my browser its working fine for my windows chrome but when I run the test case on MAC PC chrome browser or any Mozilla browser it does not maximize my browser? Is there any solution to solve this problem?

Zakaria Shahed
  • 2,589
  • 6
  • 23
  • 52

2 Answers2

1

Try it for chrome:

ChromeOptions option = ChromeOptions();
option.add_argument("--start-maximized");
iamsankalp89
  • 4,607
  • 2
  • 15
  • 36
0

The argument "--kiosk" for ChromeOptions on MAC open a full screen driver. The maximize option on Windows OS works different as MacOS. On Windows is close to a full screen and on MacOs is like adjust to top and bottom.

ChromeOptions option = ChromeOptions();
option.add_argument("--kiosk");

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
j.barrio
  • 1,006
  • 1
  • 13
  • 37