Class Module

java.lang.Object
org.openqa.selenium.bidi.Module

@Beta public abstract class Module extends Object
Base class for generated BiDi module classes.

Subclasses delegate all wire operations through the driver's shared Handle — no new WebSocket connection is opened.

  • Constructor Details

    • Module

      protected Module(WebDriver driver)
  • Method Details

    • send

      protected final <X> X send(Command<X> command)
    • subscribe

      public final <X> String subscribe(Event<X> event, Consumer<X> handler)
      Subscribes to a BiDi event, globally across all browsing contexts.
      Type Parameters:
      X - the event's parameter type
      Parameters:
      event - the event to subscribe to
      handler - invoked with the event's parameters each time it fires
      Returns:
      a subscription id that can be passed to unsubscribe(String)
    • unsubscribe

      public final void unsubscribe(String subscriptionId)
      Cancels a previously registered event subscription.
      Parameters:
      subscriptionId - a subscription id previously returned by subscribe(Event, Consumer)