The method called instantiateWebDriver() is basically the code that was previously inside getDriver(). We have just moved it out to isolate the function of actually instantiating a WebDriver object. The method called determineEffectiveDriverType() will take the browser variable and then try and work out which enum value maps across to the value it holds. If it cannot map a DriverType across to the value of browser, it will log an error and then default to our defaultDriverType.
The nal part is the changes we have made to the getDriver() method. It now uses the new methods in WebDriverThread and DriverType to set up and return a valid WebDriver instance for your checks.
Please sign in to leave a comment.