selva
selva

Reputation: 1175

Switching to the Parent Window in Selenium Webdriver

i'm new to selenium so i don't know weather to ask this question or not please correct me if im wrong ..

i have a site where clicking a button opens the link in a new tab i have succefull used the selenium windowhandle and done the work on the new open tab but when switching to the parent tab i have a problem that is the code is being executed in that parent tab but the tab is not being focused so i can't see how my code is being executed in parent window for that i know to press Crlt +1 using java robot but is there any other way of haveing the focus back to my parent window so that i can see what is happening...

Thanks in Advance

Upvotes: 1

Views: 6041

Answers (2)

Harshavardhan Konakanchi
Harshavardhan Konakanchi

Reputation: 4294

To bring the window to front of all the windows I think you can try this.

webdriver .manage().window().maximize();

Upvotes: 1

burtyish
burtyish

Reputation: 1043

This is what I use:

webDriver.switchTo().window(webDriver.getWindowHandles().toArray()[0])

Upvotes: 3

Related Questions