Class BrowseTheWeb

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.shakespeareframework.Ability

    public final class BrowseTheWeb
    extends java.lang.Object
    implements org.shakespeareframework.Ability, java.lang.AutoCloseable
    Ability to browse the web using a Selenium WebDriver.
    • Constructor Detail

      • BrowseTheWeb

        public BrowseTheWeb​(WebDriverSupplier webDriverSupplier,
                            java.lang.String baseUrl)
        Parameters:
        webDriverSupplier - the WebDriverSupplier used to setup the WebDriver
        baseUrl - a URL to be opened automatically
    • Method Detail

      • getWebDriver

        public org.openqa.selenium.WebDriver getWebDriver()
        Gets the WebDriver from the webDriverSupplier and returns it.

        If a baseUrl is given, it will be opened automatically.

        Returns:
        a WebDriver instance.
        See Also:
        Supplier.get()
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object