2

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.

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

1 Answer 1

1

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 and acknowledge you have read our privacy policy.

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