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
  }

package.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",

This is the method in version 5 where we are using getcurrentTabID and windowHandles methods but in v6 it is not a function. So what should I do? Please help Thanks

1

There are 1 answers

0
Yuriy Gerasimovich On

It was changed since v5. You can now use https://webdriver.io/docs/api/webdriver.html#getwindowhandle