switchToPopUpWindow(n = -1) {
this.mainWindow = browser.getCurrentTabId()
let handles = browser.windowHandles()
n == -1 && (n = handles.value.length - 1)
browser.window(handles.value[n])
return this
}
包.json
"@wdio/cli": "^6.7.0",
"@wdio/junit-reporter": "~6.7.0",
"@wdio/local-runner": "^6.7.0",
"@wdio/mocha-framework": "^6.7.0",
"@wdio/selenium-standalone-service": "^6.6.5",
"@wdio/spec-reporter": "^6.7.0",
"@wdio/sync": "^6.7.0",
"wdio-chromedriver-service": "^6.0.4",
"wdio-mochawesome-reporter": "^4.0.0",
"webdriverio": "^6.7.0",
这是我们在版本 5 中使用的方法getcurrentTabID
和windowHandles
方法,但在 v6 中它不是函数。所以我该怎么做?请帮忙谢谢