Class PollingBrowserEventCollector

java.lang.Object
com.shaft.capture.collector.PollingBrowserEventCollector
All Implemented Interfaces:
BrowserEventCollector, AutoCloseable

public final class PollingBrowserEventCollector extends Object implements BrowserEventCollector
Classic WebDriver fallback for browsers where BiDi collection is unavailable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver)
    Creates a classic WebDriver collector.
    PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning)
    Creates a classic WebDriver collector.
    PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes)
    Creates a classic WebDriver collector.
    PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes, String eventEndpoint, String eventToken)
    Creates a classic WebDriver collector.
    PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes, String eventEndpoint, String eventToken, String stepsEndpoint)
    Creates a classic WebDriver collector with a steps-rehydration endpoint so the recorder UI can source its step list from the server-side session store across navigations, including cross-origin ones, instead of page-scoped storage.
    PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes, String eventEndpoint, String eventToken, String stepsEndpoint, BooleanSupplier recentBidiActivity)
    Creates a classic WebDriver collector that skips its own redundant script round-trips while recentBidiActivity reports that a BiDi collector running alongside it is already delivering the same signals, and resumes full-rate polling the moment BiDi goes quiet.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Stops collection and releases protocol listeners.
    void
    start(Consumer<BrowserSignal> signalConsumer, Consumer<String> warningConsumer)
    Starts event collection.

    Methods inherited from class Object

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

    • PollingBrowserEventCollector

      public PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver)
      Creates a classic WebDriver collector.
      Parameters:
      driver - active driver
    • PollingBrowserEventCollector

      public PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning)
      Creates a classic WebDriver collector.
      Parameters:
      driver - active driver
      reportFallbackWarning - whether status should report reduced BiDi coverage
    • PollingBrowserEventCollector

      public PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes)
      Creates a classic WebDriver collector.
      Parameters:
      driver - active driver
      reportFallbackWarning - whether status should report reduced BiDi coverage
      testIdAttributes - locator test-id attributes
    • PollingBrowserEventCollector

      public PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes, String eventEndpoint, String eventToken)
      Creates a classic WebDriver collector.
      Parameters:
      driver - active driver
      reportFallbackWarning - whether status should report reduced BiDi coverage
      testIdAttributes - locator test-id attributes
      eventEndpoint - optional loopback event endpoint
      eventToken - optional loopback event token
    • PollingBrowserEventCollector

      public PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes, String eventEndpoint, String eventToken, String stepsEndpoint)
      Creates a classic WebDriver collector with a steps-rehydration endpoint so the recorder UI can source its step list from the server-side session store across navigations, including cross-origin ones, instead of page-scoped storage.
      Parameters:
      driver - active driver
      reportFallbackWarning - whether status should report reduced BiDi coverage
      testIdAttributes - locator test-id attributes
      eventEndpoint - optional loopback event endpoint
      eventToken - optional loopback event token
      stepsEndpoint - optional loopback steps query endpoint
    • PollingBrowserEventCollector

      public PollingBrowserEventCollector(org.openqa.selenium.WebDriver driver, boolean reportFallbackWarning, List<String> testIdAttributes, String eventEndpoint, String eventToken, String stepsEndpoint, BooleanSupplier recentBidiActivity)
      Creates a classic WebDriver collector that skips its own redundant script round-trips while recentBidiActivity reports that a BiDi collector running alongside it is already delivering the same signals, and resumes full-rate polling the moment BiDi goes quiet.
      Parameters:
      driver - active driver
      reportFallbackWarning - whether status should report reduced BiDi coverage
      testIdAttributes - locator test-id attributes
      eventEndpoint - optional loopback event endpoint
      eventToken - optional loopback event token
      stepsEndpoint - optional loopback steps query endpoint
      recentBidiActivity - reports true while BiDi is proven healthy
  • Method Details