public void selectMainWindow ( ) { String action = "Switching to main window" ; String expected = "Main window is selected" ; try { driver . switchTo ( ) . defaultContent ( ) ; } catch ( Exception e ) { reporter . fail ( action , expected , "Main window was not selected. " + e . getMessage ( ) ) ; log . warn ( e ) ; return ; } reporter . pass ( action , expected , expected ) ; }
Select the main window . Used for returning to the main content after selecting a frame . If there are nested frames the main content will be selected not the next frame in the parent child relationship