Class AppiumUserAgentFilter

java.lang.Object
io.appium.java_client.internal.filters.AppiumUserAgentFilter
All Implemented Interfaces:
Function<org.openqa.selenium.remote.http.HttpHandler,org.openqa.selenium.remote.http.HttpHandler>, org.openqa.selenium.remote.http.Filter

public class AppiumUserAgentFilter extends Object implements org.openqa.selenium.remote.http.Filter
Manage Appium Client configurations.
  • Field Details

    • VERSION_KEY

      public static final String VERSION_KEY
      See Also:
    • USER_AGENT

      public static final String USER_AGENT
      A default User Agent name for Appium Java client. e.g. appium/8.2.0 (selenium/4.5.0 (java mac))
  • Constructor Details

    • AppiumUserAgentFilter

      public AppiumUserAgentFilter()
  • Method Details

    • buildUserAgent

      public static String buildUserAgent(@Nullable String userAgent)
      Returns the User Agent. If the given UA already has USER_AGENT_PREFIX, it returns the UA. IF the given UA does not have USER_AGENT_PREFIX, it returns UA with the Appium prefix.
      Parameters:
      userAgent - the User Agent in the request headers.
      Returns:
      the User Agent for the request
    • apply

      public org.openqa.selenium.remote.http.HttpHandler apply(org.openqa.selenium.remote.http.HttpHandler next)
      Specified by:
      apply in interface Function<org.openqa.selenium.remote.http.HttpHandler,org.openqa.selenium.remote.http.HttpHandler>