Interface BrowserConfig

All Known Implementing Classes:
ChromeConfig, EdgeConfig, FirefoxConfig

public interface BrowserConfig
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openqa.selenium.MutableCapabilities
    Fetch the default capabilities from the browser.
    org.openqa.selenium.MutableCapabilities
    defaultOptions(boolean headless, String downloadFolderPath, String userDataDir, PageLoadStrategy pageLoadStrategy)
    Retrieve the default options from the browser curated by BotCity.
    org.openqa.selenium.remote.HttpCommandExecutor
    executor(org.openqa.selenium.WebDriver driver)
    Get browser executor.
    Get driver name from the browser.
    org.openqa.selenium.remote.SessionId
    Get the session id.
    org.openqa.selenium.WebDriver
    Get driver instance.
    waitForDownloads(org.openqa.selenium.WebDriver driver)
    Wait for all downloads to finish.
  • Method Details

    • defaultOptions

      org.openqa.selenium.MutableCapabilities defaultOptions(boolean headless, String downloadFolderPath, String userDataDir, PageLoadStrategy pageLoadStrategy)
      Retrieve the default options from the browser curated by BotCity.

      Parameters:
      headless - Whether or not to use the headless mode.
      downloadFolderPath - The default path in which to save files.
      userDataDir - The directory to use as user profile.
      pageLoadStrategy - The page load strategy.
      Returns:
      The Browser options.
    • defaultCapabilities

      org.openqa.selenium.MutableCapabilities defaultCapabilities()
      Fetch the default capabilities from the browser.

      Returns:
      MutableCapabilities with the default capabilities defined.
    • waitForDownloads

      Object waitForDownloads(org.openqa.selenium.WebDriver driver)
      Wait for all downloads to finish. Important: This method overwrites the current page with the downloads page.

      Parameters:
      driver - The WebDriver instance.
      Returns:
      True if all downloads finished, false otherwise.
    • getDriverName

      String getDriverName()
      Get driver name from the browser.

      Returns:
      The driver name.
    • getWebDriverDriver

      org.openqa.selenium.WebDriver getWebDriverDriver()
      Get driver instance.

      Returns:
      WebDriver instance.
    • executor

      org.openqa.selenium.remote.HttpCommandExecutor executor(org.openqa.selenium.WebDriver driver)
      Get browser executor.

      Parameters:
      driver - The WebDriver instance.
      Returns:
      HttpCommandExecutor instance.
    • getSessionId

      org.openqa.selenium.remote.SessionId getSessionId()
      Get the session id.

      Returns:
      SessionId instance.