switchWindow

Switch focus to a particular tab / window.

Usage#
browser.switchWindow(urlOrTitleToMatch)
Parameters#
NameTypeDetails
urlOrTitleToMatchString, RegExpString or regular expression that matches the title or url of the page
Example#
switchWindow.js
it('should switch to another window', () => {
// open url
browser.url('https://google.com')
// create new window
browser.newWindow('https://webdriver.io')
// switch back via url match
browser.switchWindow('google.com')
// switch back via title match
browser.switchWindow('Next-gen browser and mobile automation test framework for Node.js')
});