theintern / leadfoot

A JavaScript client library that brings cross-platform consistency to the Selenium WebDriver API.
Other
170 stars 24 forks source link

maximizeWindow() broken on Chrome #177

Closed wkeese closed 5 years ago

wkeese commented 5 years ago

The .maximizeWindow() command returns an error on Chrome:

UnknownError: [POST http://localhost:4444/wd/hub/session/9aa8f5396e8d54698f4715cf4715fbcc/window/current/maximize] unknown error: failed to change window state to maximized, current state is normal

Judging from https://w3c.github.io/webdriver/#maximize-window the command should be window/maximize rather than window/current/maximize So I tried explicitly setting usesWebDriverWindowCommands to true:

"environments": [
    {
        "browserName": "chrome",
        "capabilities": {
            "usesWebDriverWindowCommands": true
        }
    }
]

That makes Intern do a POST of window/maximize rather than window/current/maximize but Chrome doesn't like that either. It gets the same error:

UnknownError: [POST http://localhost:4444/wd/hub/session/56e9018d634495a84e217da0bcfe2d3d/window/maximize] unknown error: failed to change window state to maximized, current state is normal

jason0x43 commented 5 years ago

Could you provide a bit more environmental info? At least on macOS with Chrome 74, digdug 2.2.4, and leadfoot 2.2.10, maximize seems to be working.

jason0x43 commented 5 years ago

Also, are the feature tests running, or is fixSessionCapabilities set to false or 'no-detect'?

wkeese commented 5 years ago

Oh, looks like it just got fixed. I was testing on macOS, leadfoot 2.2.9, DigDig 2.2.3, and Chrome 74. Just upgraded to Chrome 75, leadfoot 2.2.10, and DigDug 2.2.4, and now it's working!

(I guess those new versions of leadfoot and digdug are included in the new Intern you released 6 minutes ago.)

Just to answer your other question, I tried fixSessionCapabilities both undefined (i.e. feature tests running), and no-detect, but as I said above, I also tried explicitly setting usesWebDriverWindowCommands.