public void resize ( int width , int height ) { String action = "Resizing browser to " + width + " x " + height ; String expected = "Browser is resized to " + width + " x " + height ; try { Dimension dimension = new Dimension ( width , height ) ; driver . manage ( ) . window ( ) . setSize ( dimension ) ; } catch ( Exception e ) { reporter . fail ( action , expected , "Browser was unable to be resized. " + e . getMessage ( ) ) ; log . warn ( e ) ; return ; } reporter . pass ( action , expected , expected ) ; }
Resizes the current window to the specified size