Class WebDriverBuilder

java.lang.Object
com.version1.webdriver.WebDriverBuilder

public class WebDriverBuilder extends Object
This class uses the Builder Pattern to construct its options. Calling .build() will result in all of the configuration options being assembled and a valid WebDriver object being supplied to the caller
  • Constructor Details

    • WebDriverBuilder

      public WebDriverBuilder()
  • Method Details

    • setResultsDirectory

      public WebDriverBuilder setResultsDirectory(File screenshotDirectory)
      Parameters:
      screenshotDirectory - path for the directory storing screenshots
      Returns:
      WebDriverBuilder as using builder pattern
    • build

      public org.openqa.selenium.support.events.EventFiringWebDriver build() throws IOException
      The build method pulls all of the configuration options together and uses them to construct an EventFiringWebDriver with the correct configuration for the browser type
      Returns:
      EventFiringWebDriver representing the configured driver
      Throws:
      IOException - if log file for browser driver logs cannot be created
    • build

      public org.openqa.selenium.support.events.EventFiringWebDriver build(String browser) throws IOException
      Throws:
      IOException