Currently experiencing an issue with switching between different browser tabs.
The code in my test class is as follows:
describe('Validate tab switching functionality', () => {
beforeEach(function() {
browser.url("https://duckduckgo.com")
});
it('Switch tab', () => {
browser.newWindow('https://webdriver.io')
browser.switchToWindow('DuckDuckGo — Privacy, simplified.');
})
})
I keep encountering the following exception:
[0-0] 2019-07-24T10:22:26.116Z ERROR webdriver: Request failed due to Error: no such window
(Session info: chrome=75.0.3770.142)
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.17134 x86_64)
at getErrorFromResponseBody (C:\Users\Gianni Bruno\Desktop\webdriverio-v5\node_modules\webdriver\build\utils.js:371:10)
at Request._callback (C:\Users\Gianni Bruno\Desktop\webdriverio-v5\node_modules\webdriver\build\request.js:120:64)
at Request.self.callback (C:\Users\Gianni Bruno\Desktop\webdriverio-v5\node_modules\request\request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request.<anonymous> (C:\Users\Gianni Bruno\Desktop\webdriverio-v5\node_modules\request\request.js:1161:10)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at IncomingMessage.<anonymous> (C:\Users\Gianni Bruno\Desktop\webdriverio-v5\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:286:20)
[0-0] Error in "Validate switching of tabs Switch tabs"
no such window
(Session info: chrome=75.0.3770.142)
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.17134 x86_64)
Your assistance would be greatly appreciated.