Class BrowserDrone

java.lang.Object
uno.anahata.asi.yam.tools.browser.BrowserDrone

public class BrowserDrone extends Object
Represents a single browser WebDriver connection and its associated state.

This acts as the universal tracking object for headless and visible browser sessions across different implementations (e.g., Chrome, Firefox).

Author:
anahata
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Optional path to the browser binary (e.g. for Snap or custom installs).
    Tracks the current URL of the drone's active tab.
    org.openqa.selenium.WebDriver
    The active WebDriver instance.
    boolean
    Indicates whether this drone is running in an invisible headless mode.
    The unique identifier for this drone.
    boolean
    Indicates whether the drone is currently in the process of starting up.
    Stores the last error message encountered by this drone, if any.
    int
    The remote debugging port used to connect to the browser.
    The browser profile directory name (e.g., 'Default', 'Profile 1').
    The absolute path to the user data directory containing the profiles.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Public constructor to provide documentation and instantiate a new drone.
  • Method Summary

    Methods inherited from class Object

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

    • driver

      public transient org.openqa.selenium.WebDriver driver
      The active WebDriver instance. Marked transient as the live network connection cannot be persisted across session restarts.
    • initializing

      public transient boolean initializing
      Indicates whether the drone is currently in the process of starting up. Marked transient as it only applies to the current runtime execution.
    • id

      public String id
      The unique identifier for this drone.
    • port

      public int port
      The remote debugging port used to connect to the browser.

      A value of -1 indicates that no connection has been established or the port hasn't been assigned yet.

    • profile

      public String profile
      The browser profile directory name (e.g., 'Default', 'Profile 1').

      Used to maintain consistent cookies and authentication across restarts.

    • userDataDir

      public String userDataDir
      The absolute path to the user data directory containing the profiles.

      Required for visual mode to locate existing Chrome/Firefox structures.

    • headless

      public boolean headless
      Indicates whether this drone is running in an invisible headless mode.
    • binaryPath

      public String binaryPath
      Optional path to the browser binary (e.g. for Snap or custom installs).
    • currentUrl

      public String currentUrl
      Tracks the current URL of the drone's active tab.

      This is updated after every navigation event to provide quick context without requiring a remote driver query.

    • lastError

      public String lastError
      Stores the last error message encountered by this drone, if any.

      Used by AbstractBrowser.getStatus(String) to provide diagnostic feedback when a session fails to start.

  • Constructor Details

    • BrowserDrone

      public BrowserDrone()
      Public constructor to provide documentation and instantiate a new drone.