sourcegraph / go-selenium

Selenium WebDriver client for Go
https://sourcegraph.com/github.com/sourcegraph/go-selenium
Other
367 stars 73 forks source link

Selenium ChromeDriver switch tabs #36

Closed fy138 closed 7 years ago

fy138 commented 7 years ago

When I click on a link in my test, it opens a new tab. I want ChromeDriver to then focus on that tab. how do i do ?

fy138 commented 7 years ago

for this using sendkey ctrl+num http://www.software-testing-tutorials-automation.com/2015/02/how-to-open-tab-and-switching-between.html

fy138 commented 7 years ago

tabs is a window ,you can use WList, _ := webDriver.WindowHandles() webDriver.SwitchWindow(WList[1]) choice diff window