-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
area:testsUpdates to testsUpdates to testsbackport:requestedShould be applied to the maintained (previous) versionShould be applied to the maintained (previous) versionhelp:wantedAdditional help is neededAdditional help is neededrelease:nextInclude in the next release within its trackInclude in the next release within its tracksemver:patchChanges that don't affect the API (bug fixes)Changes that don't affect the API (bug fixes)status:investigatingNeeds definition before work can startNeeds definition before work can starttrack:mainFor the current stable version trackFor the current stable version tracktype:bugSomething isn't workingSomething isn't working
Milestone
Description
I’m trying to run two Electron sessions simultaneously using WebdriverIO's multiremote mode. While the test itself does not crash and continues running, the console outputs the following errors:
ERROR @wdio/utils:shim: TypeError: Cannot read properties of undefined (reading 'windowHandle')
at switchToActiveWindow (D:\qweasdqwe\node_modules\src\window.ts:35:87)
at ensureActiveWindowFocus (D:\qweasdqwe\node_modules\src\window.ts:59:13)
at ElectronWorkerService.beforeCommand (D:\qweasdqwe\node_modules\src\service.ts:157:5)
at async Promise.all (index 0)
at Browser.executeHooksWithArgs (D:\qweasdqwe\node_modules\@wdio\utils\build\index.js:890:18)
at Browser.wrapCommandFn (D:\qweasdqwe\node_modules\@wdio\utils\build\index.js:901:7)
at async Promise.all (index 0)
at MultiRemoteDriver.<anonymous> (D:\qweasdqwe\node_modules\webdriverio\build\node.js:8526:22)
at MultiRemoteDriver.wrapCommandFn (D:\qweasdqwe\node_modules\@wdio\utils\build\index.js:907:23)
at async Runner.endSession (file:///D:/qweasdqwe/node_modules/@wdio/runner/build/index.js:909:5)
at async Runner.run (file:///D:/qweasdqwe/node_modules/@wdio/runner/build/index.js:761:7)
ERROR webdriver: WebDriverError: javascript error: Cannot read properties of undefined (reading 'execute')
(Session info: chrome=124.0.6367.243) when running "execute/sync" with method "POST" and args "function executeWithinElectron(script, ...args) {
return window.wdioElectron.execute(script, args);
}"
This only occurs when running more than one session. If I run the test with just a single Electron session, everything works as expected with no errors.
Here is my capabilities setup:
capabilities: {
firstSession: {
capabilities: {
browserName: 'electron',
browserVersion: '124.0.6367.243',
'wdio:electronServiceOptions': {
appBinaryPath: 'C:/Users/UserName/AppData/Local/slack/app-4.44.59/slack.exe',
appArgs: []
}
}
},
secondSession: {
capabilities: {
browserName: 'electron',
browserVersion: '124.0.6367.243',
'wdio:electronServiceOptions': {
appBinaryPath: 'C:/Users/UserName/AppData/Local/slack/app-4.44.59/slack.exe',
appArgs: []
}
}
}
}
📌 Notes:
- Tested using WebdriverIO with the Electron service plugin.
- Using browserVersion: 124.0.6367.243.
- Also tested using the official Slack Electron app — the same errors appear in the console.
- Issue happens regardless of the app path or args.
- My expectation is to be able to run two Electron sessions via multiremote without encountering internal errors.
- Let me know if you need a minimal reproduction repo.
Metadata
Metadata
Assignees
Labels
area:testsUpdates to testsUpdates to testsbackport:requestedShould be applied to the maintained (previous) versionShould be applied to the maintained (previous) versionhelp:wantedAdditional help is neededAdditional help is neededrelease:nextInclude in the next release within its trackInclude in the next release within its tracksemver:patchChanges that don't affect the API (bug fixes)Changes that don't affect the API (bug fixes)status:investigatingNeeds definition before work can startNeeds definition before work can starttrack:mainFor the current stable version trackFor the current stable version tracktype:bugSomething isn't workingSomething isn't working