private WebDriver generateWebDriver ( String driverName ) throws TechnicalException { WebDriver driver ; if ( IE . equals ( driverName ) ) { driver = generateIEDriver ( ) ; } else if ( CHROME . equals ( driverName ) ) { driver = generateGoogleChromeDriver ( ) ; } else if ( FIREFOX . equals ( driverName ) ) { driver = generateFirefoxDriver ( ) ; } else { driver = generateGoogleChromeDriver ( ) ; } // As a workaround: NoraUi specify window size manually, e.g. window_size: 1920 x 1080 (instead of .window().maximize()). driver . manage ( ) . window ( ) . setSize ( new Dimension ( 1920 , 1080 ) ) ; driver . manage ( ) . timeouts ( ) . implicitlyWait ( IMPLICIT_WAIT , TimeUnit . MILLISECONDS ) ; drivers . put ( driverName , driver ) ; return driver ; }
Generates a selenium webdriver following a name given in parameter . By default a chrome driver is generated .