switchWindow
Switch focus to a particular tab / window.
Usage
browser.switchWindow(urlOrTitleToMatch)
Parameters
Name | Type | Details |
---|---|---|
urlOrTitleToMatch | String , RegExp | String or regular expression that matches the title or url of the page |
Example
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 WebDriver test framework')
});