-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.0.7
Node.js Version
20
Mode
Standalone Mode
Which capabilities are you using?
Default Chrome within Jasmine boilerplate project attached as an exampleWhat happened?
In the more recent versions of WebdriverIO V9 ~9.0.7 after updating all my tests that required tab or window switching we failing. Upon investigation there seems to be some regression or breaking change where switchWindow doesn't behave as expected and using the devtools logic of not switchingWindows doesn't work either.
What is your expected behavior?
I would expect WebdriverIO to be able to switchWindows and context either by default like devtools or by the switchWindow function that worked up until a very recent change.
How to reproduce the bug.
Pull down my forked Jasmine-Boilerplate project and run the two tests with npm run test:local
https://github.com/DanLambe/jasmine-boilerplate
Relevant log output
2024-08-23T17:53:58.729Z INFO @wdio/local-runner: Run worker command: run
2024-08-23T17:53:58.735Z DEBUG @wdio/runner: init remote session
2024-08-23T17:53:58.794Z DEBUG @wdio/runner: init remote session
2024-08-23T17:53:58.795Z INFO webdriver: Initiate new session using the WebDriver protocol
2024-08-23T17:53:59.035Z INFO webdriver: Setting up chrome v128.0.6613.84
2024-08-23T17:53:59.085Z INFO webdriver: Using Chromedriver v128.0.6613.84 from cache directory C:\Users\sheer\AppData\Local\Temp
2024-08-23T17:54:00.104Z INFO @wdio/utils: Started Chromedriver v128.0.6613.84 with params --port=50122 --allowed-origins=* --allowed-ips=0.0.0.0 in 1309ms on port 50122
2024-08-23T17:54:00.111Z INFO webdriver: [POST] http://localhost:50122/session
2024-08-23T17:54:00.111Z INFO webdriver: DATA {
capabilities: {
alwaysMatch: {
browserName: 'chrome',
'goog:chromeOptions': [Object],
webSocketUrl: true
},
firstMatch: [ {} ]
},
desiredCapabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
binary: 'C:\\Users\\sheer\\AppData\\Local\\Temp\\chrome\\win64-128.0.6613.84\\chrome-win64\\chrome.exe'
},
webSocketUrl: true
}
}
2024-08-23T17:54:00.633Z INFO webdriver: Register BiDi handler for session with id c54c2ea4f9e75c2c31fab1ebd42bf937
2024-08-23T17:54:00.633Z INFO webdriver: Connect to webSocketUrl ws://127.0.0.1:50122/session/c54c2ea4f9e75c2c31fab1ebd42bf937
2024-08-23T17:54:00.637Z INFO webdriver: Connected session to Bidi protocol
2024-08-23T17:54:00.637Z INFO webdriver: Connected session to Bidi protocol
2024-08-23T17:54:00.637Z INFO webdriver: Connected to WebDriver Bidi interface at ws://127.0.0.1:50122/session/c54c2ea4f9e75c2c31fab1ebd42bf937
2024-08-23T17:54:00.637Z INFO webdriver: BIDI COMMAND script.addPreloadScript { functionDeclaration: <PreloadScript[868 bytes]>, contexts: undefined }
2024-08-23T17:54:00.638Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.navigationStarted","network.responseCompleted","network.beforeRequestSent","network.fetchError"]}
2024-08-23T17:54:00.638Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.userPromptOpened"]}
2024-08-23T17:54:00.639Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["browsingContext.navigationStarted"]}
2024-08-23T17:54:00.639Z INFO webdriver: BIDI COMMAND session.subscribe {"events":["log.entryAdded"]}
2024-08-23T17:54:00.643Z DEBUG webdriver: BIDI RESULT {"id":3,"result":{},"type":"success"}
2024-08-23T17:54:00.643Z DEBUG webdriver: BIDI RESULT {"id":4,"result":{},"type":"success"}
2024-08-23T17:54:00.643Z DEBUG webdriver: BIDI RESULT {"id":5,"result":{},"type":"success"}
2024-08-23T17:54:00.644Z DEBUG webdriver: BIDI RESULT {"id":1,"result":{"script":"074bfd66-0d2f-4141-9044-f1813f2e7f51"},"type":"success"}
2024-08-23T17:54:00.644Z DEBUG webdriver: BIDI RESULT {"id":2,"result":{},"type":"success"}
2024-08-23T17:54:00.647Z DEBUG @wdio/utils:shim: Finished to run "beforeTest" hook in 0ms
2024-08-23T17:54:00.648Z INFO webdriver: COMMAND getWindowHandle()
2024-08-23T17:54:00.648Z INFO webdriver: [GET] http://localhost:50122/session/c54c2ea4f9e75c2c31fab1ebd42bf937/window
2024-08-23T17:54:00.650Z INFO webdriver: RESULT 669BC74EFC91B228BDF3DA1B604EE903
2024-08-23T17:54:00.650Z INFO webdriver: BIDI COMMAND browsingContext.navigate {"context":"669BC74EFC91B228BDF3DA1B604EE903","url":"http://the-internet.herokuapp.com/windows","wait":"complete"}
2024-08-23T17:54:00.653Z INFO webdriver: COMMAND getWindowHandle()
2024-08-23T17:54:00.653Z INFO webdriver: [GET] http://localhost:50122/session/c54c2ea4f9e75c2c31fab1ebd42bf937/window
2024-08-23T17:54:00.655Z INFO webdriver: RESULT 669BC74EFC91B228BDF3DA1B604EE903
2024-08-23T17:54:00.655Z INFO webdriverio:ContextManager: Update current context: 669BC74EFC91B228BDF3DA1B604EE903
2024-08-23T17:54:01.296Z DEBUG webdriver: BIDI RESULT {"id":6,"result":{"navigation":"bdc7fb1d-fe98-4a3a-be30-44ae64ad36ee","url":"https://the-internet.herokuapp.com/windows"},"type":"success"}
2024-08-23T17:54:01.297Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//a[normalize-space(text()) = \"Click Here\"] | .//a[not(.//a[normalize-space(text()) = \"Click Here\"]) and normalize-space() = \"Click Here\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:01.300Z DEBUG webdriver: BIDI RESULT {"id":7,"result":{"nodes":[{"sharedId":"f.669BC74EFC91B228BDF3DA1B604EE903.d.4E5DAB4EF66CD2105A6C51BA356640D9.e.4","type":"node","value":{"attributes":{",":"","href":"/windows/new","target":"_blank"},"childNodeCount":1,"localName":"a","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
2024-08-23T17:54:01.304Z INFO webdriver: BIDI COMMAND script.callFunction {"functionDeclaration":"<Function[5338 bytes]>","awaitPromise":false,"arguments":[{"sharedId":"f.669BC74EFC91B228BDF3DA1B604EE903.d.4E5DAB4EF66CD2105A6C51BA356640D9.e.4"}],"target":{"context":"669BC74EFC91B228BDF3DA1B604EE903"}}
2024-08-23T17:54:01.307Z DEBUG webdriver: BIDI RESULT {"id":8,"result":{"realm":"2170561311408543738.7117217003302546026","result":{"type":"boolean","value":true},"type":"success"},"type":"success"}
2024-08-23T17:54:01.307Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//a[normalize-space(text()) = \"Click Here\"] | .//a[not(.//a[normalize-space(text()) = \"Click Here\"]) and normalize-space() = \"Click Here\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:01.308Z DEBUG webdriver: BIDI RESULT {"id":9,"result":{"nodes":[{"sharedId":"f.669BC74EFC91B228BDF3DA1B604EE903.d.4E5DAB4EF66CD2105A6C51BA356640D9.e.4","type":"node","value":{"attributes":{",":"","href":"/windows/new","target":"_blank"},"childNodeCount":1,"localName":"a","namespaceURI":"http://www.w3.org/1999/xhtml","nodeType":1,"shadowRoot":null}}]},"type":"success"}
2024-08-23T17:54:01.310Z INFO webdriver: COMMAND elementClick("f.669BC74EFC91B228BDF3DA1B604EE903.d.4E5DAB4EF66CD2105A6C51BA356640D9.e.4")
2024-08-23T17:54:01.310Z INFO webdriver: [POST] http://localhost:50122/session/c54c2ea4f9e75c2c31fab1ebd42bf937/element/f.669BC74EFC91B228BDF3DA1B604EE903.d.4E5DAB4EF66CD2105A6C51BA356640D9.e.4/click
2024-08-23T17:54:01.355Z INFO webdriver: RESULT null
2024-08-23T17:54:01.356Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:01.358Z DEBUG webdriver: BIDI RESULT {"id":10,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:01.359Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:01.363Z DEBUG webdriver: BIDI RESULT {"id":11,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:01.871Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:01.873Z DEBUG webdriver: BIDI RESULT {"id":12,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:02.387Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:02.389Z DEBUG webdriver: BIDI RESULT {"id":13,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:02.900Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:02.902Z DEBUG webdriver: BIDI RESULT {"id":14,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:03.410Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:03.412Z DEBUG webdriver: BIDI RESULT {"id":15,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:03.922Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:03.923Z DEBUG webdriver: BIDI RESULT {"id":16,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:04.437Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:04.439Z DEBUG webdriver: BIDI RESULT {"id":17,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:04.951Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:04.953Z DEBUG webdriver: BIDI RESULT {"id":18,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:05.464Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:05.466Z DEBUG webdriver: BIDI RESULT {"id":19,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:05.979Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:05.981Z DEBUG webdriver: BIDI RESULT {"id":20,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:06.495Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:06.497Z DEBUG webdriver: BIDI RESULT {"id":21,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:07.007Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:07.008Z DEBUG webdriver: BIDI RESULT {"id":22,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:07.518Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:07.520Z DEBUG webdriver: BIDI RESULT {"id":23,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:08.031Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:08.033Z DEBUG webdriver: BIDI RESULT {"id":24,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:08.542Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:08.544Z DEBUG webdriver: BIDI RESULT {"id":25,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:09.054Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:09.056Z DEBUG webdriver: BIDI RESULT {"id":26,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:09.567Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:09.569Z DEBUG webdriver: BIDI RESULT {"id":27,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:10.080Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:10.083Z DEBUG webdriver: BIDI RESULT {"id":28,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:10.592Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:10.593Z DEBUG webdriver: BIDI RESULT {"id":29,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:11.103Z INFO webdriver: BIDI COMMAND browsingContext.locateNodes {"locator":{"type":"xpath","value":".//h3[normalize-space(text()) = \"New Window\"] | .//h3[not(.//h3[normalize-space(text()) = \"New Window\"]) and normalize-space() = \"New Window\"]"},"context":"669BC74EFC91B228BDF3DA1B604EE903"}
2024-08-23T17:54:11.105Z DEBUG webdriver: BIDI RESULT {"id":30,"result":{"nodes":[]},"type":"success"}
2024-08-23T17:54:11.618Z DEBUG @wdio/utils:shim: Finished to run "after" hook in 0ms
2024-08-23T17:54:11.618Z INFO webdriver: COMMAND deleteSession()
2024-08-23T17:54:11.618Z INFO webdriver: [DELETE] http://localhost:50122/session/c54c2ea4f9e75c2c31fab1ebd42bf937
2024-08-23T17:54:11.645Z INFO webdriver: RESULT null
2024-08-23T17:54:11.645Z INFO webdriver: Kill driver process with PID 35168Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested