Switch to the parent window in Selenium Webdriver

advertisements

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


This is what I use:

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