I am working on the following scenario.
I have a main web page in which there is an element which opens a dialog box. It is an IFrame and when i use diver.switchTo().frame(1); to access the new popup, i can access that frame. And I'm also able to perform the required activites in that same frame. And when I click on the "OK" button in that frame, the frame gets closed. Once this frame is closed, i'm not able to access any of the elements in my main page. I used the these switch back function calls to go back to the main page:
driver.switchTo().defaultContent() and driver.switchTo().frame(0). Since the frame gets closed i also tried without any switchTo() statements. But none of them gives me control of the main page.
Can somebody suggest solutions for it? Thanks in advance!