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?
Asked
Active
Viewed 175 times
0

Zakaria Shahed
- 2,589
- 6
- 23
- 52
-
what is the error you are getting for firefox? – Kapil Sep 21 '17 at 11:49
-
it will not show any error..It's just not work – Zakaria Shahed Sep 21 '17 at 11:50
-
when firefox is launched using your code, is it not maximized by default? – Kapil Sep 21 '17 at 11:51
-
Please Read the post carefully..Its just not maximized for Mozilla – Zakaria Shahed Sep 21 '17 at 11:52
2 Answers
1
Try it for chrome:
ChromeOptions option = ChromeOptions();
option.add_argument("--start-maximized");

iamsankalp89
- 4,607
- 2
- 15
- 36
-
-
-
For firefox I don't have solution. I tried with Firefoxoptions but it didn't work. For chrome and safari it works – iamsankalp89 Sep 21 '17 at 06:24
-
1
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