For moving back to parent frame in Selenium,
driver.switchTo().parentFrame();
is used. In my example website, I achieved same functionality using driver.s
It does have difference to an extent. Suppose you have a page having frame 'three' inside a frame 'two' inside another frame 'one', considering that you are on the frame 'three' which is inner most...
driver.switchTo().parentFrame();
- This will shift focus back to frame 'two'.
driver.switchTo().defaultContent();
- This will shift focus back to main (default) content in which frame 'one' lies.
I hope this was helpful. Thanks !