Skip to main content

Handling A Popup using selenium - how to switch back on parent window from child?

Source Link
Saurav
  • 11
  • 1
  • 2

Handling A Popup

So I have to upload a document, and the popup for file explorer loads and my code can find the document I need, but how do I then switch back to my original browser? Here is the code:

        driver.SwitchTo().ActiveElement().SendKeys("C:\\Users\\Saurav\\Downloads\\GGPrezi.pptx");

It is able to select the document but now I need to get back to the original browser, how do I do that?