I m having the login page, when click login button it opens the new tab.
i moved the control to new window using,
driver.switchTo().window("windowname");
// done some stuffs in new window.
When I click one "Button" it will open the new popup (that popup is not a normal window it is a iframe).
I have selected a popup window using,
driver.switchTo().frame("frameName");
That popup has the list of records; each record has the separate "select" option (with the dynamically changing id's).
driver.findElement(By.xpath("//a[@id='radgrdPeople_ctl00_ctl04_lnkSelect']")).click();
When selecting the record from list, the popup window will be closed and the page will get refreshed.
Now I want to return the control to my parent window for doing some other stuff.
The record got selected successfully. But i could not able to focus the parent window again.
I have tried:
driver.switchTo().defaultcontent();
driver.switchTo().window("");
And driver.getWindowHandles()
Still I m getting the same problem.
I don't know whether I have to use any java script executor for handling the dynamically changing element id's.
Could u any one please help me on this....
Thanks in Advance.
By K.Ranjithkumar