public static WebDriver getWebDriver ( String browserProperties , URL remoteUrl ) throws IOException { URL resource = Thread . currentThread ( ) . getContextClassLoader ( ) . getResource ( browserProperties ) ; log . debug ( "File: {} " + ( resource != null ? "exists" : "does not exist" ) , browserProperties ) ; if ( resource != null ) { Browser browser = findBrowser ( resource . openStream ( ) ) ; return getDriver ( browser , resource . openStream ( ) , remoteUrl ) ; } return null ; }
Create and return new WebDriver or RemoteWebDriver based on properties file