public void switchWindow ( ) { List < String > windowHandles = new ArrayList <> ( getWindowHandles ( ) ) ; getDriver ( ) . switchTo ( ) . window ( windowHandles . get ( windowHandles . size ( ) - 1 ) ) ; }
switches to the last opened window