public void openNewWindow ( String url ) { String action = "Opening new window to url " + url ; String expected = "New window is opened to url " + url ; try { JavascriptExecutor jse = ( JavascriptExecutor ) driver ; jse . executeScript ( "window.open('" + url + "','_blank');" ) ; } catch ( Exception e ) { reporter . fail ( action , expected , "Unable to open window tab. " + e . getMessage ( ) ) ; log . warn ( e ) ; return ; } switchToNewWindow ( ) ; waitFor ( ) . urlEquals ( url ) ; if ( ! get ( ) . url ( ) . equals ( url ) ) { reporter . fail ( action , expected , "Unable to open new window to " + url ) ; return ; } reporter . pass ( action , expected , expected ) ; acceptCertificate ( ) ; }
Opens a new tab and have it selected . The page provided will be loaded