为了账号安全,请及时绑定邮箱和手机立即绑定

无法使用 WebdriverIO (Selenium) 切换窗口

无法使用 WebdriverIO (Selenium) 切换窗口

眼眸繁星 2021-08-20 15:34:20
当前无法在不同的浏览器选项卡之间切换。我的测试类中包含的代码:describe('Validate switching of tabs', () => {    beforeEach(function() {        browser.url("https://duckduckgo.com")       });    it('Switch tab', () => {        browser.newWindow('https://webdriver.io')        browser.switchToWindow('DuckDuckGo — Privacy, simplified.');    })})似乎收到以下异常:[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)感谢您的帮助。
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 152 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信