I was wondering if anyone know why the WebDriver command: .windowMaximize() doesn't put the window of the browser (Chrome on MAC in my case) in fullscreen? The window is re-sized to fit in only half of my screen.

Is there anyway to tackle this problem? maybe by setting by myself dimensions with the command .windowSize() but the problem with that is that it will be only set for the screen I use at the moment and so I will have to change if I launch my script on a different screen.

  • Which browser are you using? – Tired Of Testing Aug 21 '17 at 18:02
  • Which os abd versiob if selenium? – dzieciou Aug 22 '17 at 6:21
  • Chrome WebDriver, sorry I forgot to mention it, I will edit the post also. – LeBrequin Aug 22 '17 at 7:56
  • are you using a Mac? – demouser123 Aug 22 '17 at 9:56
  • Yes on a Mac , however my Chrome session is launched on a computer screen not on the laptop one directly. – LeBrequin Aug 22 '17 at 9:58

On the Mac the .windowsMaximize() is interpreted as a plus button click. This represents a Size to best fit command. It is not like a Maximize on a Windows OS. It will only maximize vertically.

A workaround is to start Chrome with the start-fullscreen command: ChromeOptions options = new ChromeOptions(); options.addArguments("start-fullscreen");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.