Skip to content

(Jenkins / Xvfb) Failed to change window state to maximized #70

Open
@thymian-garden

Description

@thymian-garden

Hi,
thanks for this project, it is very helpful!
However, I have this problem every time I run my tests on my Jenkins instance:
WebDriverError: unknown error: failed to change window state to maximized, current state is normal (Session info: chrome=67.0.3396.62) (Driver info: chromedriver=2.38.552522 (...),platform=Linux 4.15.0
I am using Xvfb with the following command: Xvfb :0 -ac -screen 0 1600x1200x24
The problem seems kind of similar to this: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1901
So I tried out what happens when I delete the line driver.manage().window().maximize();... and it really makes the tests run successfully.
Would it make sense to have a parameter that allows passing a window size, and if set, the driver setup code would use driver.manage().window().setSize(windowSize); instead of driver.manage().window().maximize();?
Best regards!

edit/P.S.: My current workaround is running the following command before each execution: sed -i s/maximize\(\)/setSize\(1500,1100\)/g ./node_modules/selenium-cucumber-js/runtime/chromeDriver.js (but this is obviously a very dirty hack and I'd like to get rid of it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions