Class WebDriverManager

java.lang.Object
com.norconex.crawler.web.fetch.impl.webdriver.WebDriverManager

public class WebDriverManager extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openqa.selenium.WebDriver
    Returns the Thread‑local WebDriver, creating (and registering) it on first call.
    void
    Explicitly quit and remove the current thread's driver (optional — the driver manager will cleanup instances that were used by dead threads).
    <T> T
    safeCall(Function<org.openqa.selenium.WebDriver,T> action)
    Wrap any WebDriver action so that on failure we reset and retry once.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getDriver

      public org.openqa.selenium.WebDriver getDriver()
      Returns the Thread‑local WebDriver, creating (and registering) it on first call.
      Returns:
      web driver
    • quitDriver

      public void quitDriver()
      Explicitly quit and remove the current thread's driver (optional — the driver manager will cleanup instances that were used by dead threads).
    • safeCall

      public <T> T safeCall(Function<org.openqa.selenium.WebDriver,T> action)
      Wrap any WebDriver action so that on failure we reset and retry once.
      Type Parameters:
      T - action's return value type
      Parameters:
      action - action to perform with a web driver
      Returns:
      action's return value
    • shutdown

      public void shutdown()