Class: Selenium::WebDriver::BiDi::Protocol::Session Private

Inherits:
Domain
  • Object
show all
Defined in:
lib/selenium/webdriver/bidi/protocol/session.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: ProxyConfiguration, UnsubscribeParameters

Constant Summary collapse

USER_PROMPT_HANDLER_TYPE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  accept: 'accept',
  dismiss: 'dismiss',
  ignore: 'ignore'
}.freeze
CAPABILITY_REQUEST_FIREFOX_OPTIONS_LEVEL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{
  trace: 'trace',
  debug: 'debug',
  config: 'config',
  info: 'info',
  warn: 'warn',
  error: 'error',
  fatal: 'fatal'
}.freeze
CapabilitiesRequest =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  always_match: {wire_key: 'alwaysMatch', required: false, ref: 'Session::CapabilityRequest'},
  first_match: {wire_key: 'firstMatch', required: false, ref: 'Session::CapabilityRequest', list: true}
)
CapabilityRequest =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  accept_insecure_certs: {wire_key: 'acceptInsecureCerts', required: false, primitive: 'boolean'},
  browser_name: {wire_key: 'browserName', required: false, primitive: 'string'},
  browser_version: {wire_key: 'browserVersion', required: false, primitive: 'string'},
  platform_name: {wire_key: 'platformName', required: false, primitive: 'string'},
  proxy: {wire_key: 'proxy', required: false, ref: 'Session::ProxyConfiguration'},
  unhandled_prompt_behavior: {
    wire_key: 'unhandledPromptBehavior',
    required: false,
    ref: 'Session::UserPromptHandler'
  },
  moz_firefox_options: {
    wire_key: 'moz:firefoxOptions',
    required: false,
    ref: 'Session::CapabilityRequestFirefoxOptions'
  },
  extensible: true
)
CapabilityResponse =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  accept_insecure_certs: {wire_key: 'acceptInsecureCerts', primitive: 'boolean'},
  browser_name: {wire_key: 'browserName', primitive: 'string'},
  browser_version: {wire_key: 'browserVersion', primitive: 'string'},
  platform_name: {wire_key: 'platformName', primitive: 'string'},
  set_window_rect: {wire_key: 'setWindowRect', primitive: 'boolean'},
  user_agent: {wire_key: 'userAgent', primitive: 'string'},
  proxy: {wire_key: 'proxy', required: false, ref: 'Session::ProxyConfiguration'},
  unhandled_prompt_behavior: {
    wire_key: 'unhandledPromptBehavior',
    required: false,
    ref: 'Session::UserPromptHandler'
  },
  web_socket_url: {wire_key: 'webSocketUrl', required: false, primitive: 'string'},
  moz_build_id: {wire_key: 'moz:buildID', required: false, primitive: 'string'},
  moz_headless: {wire_key: 'moz:headless', required: false, primitive: 'boolean'},
  moz_platform_version: {wire_key: 'moz:platformVersion', required: false, primitive: 'string'},
  moz_process_id: {
    wire_key: 'moz:processID',
    required: false,
    primitive: 'integer',
    min: 0,
    max: 9_007_199_254_740_991
  },
  moz_profile: {wire_key: 'moz:profile', required: false, primitive: 'string'},
  moz_shutdown_timeout: {
    wire_key: 'moz:shutdownTimeout',
    required: false,
    primitive: 'integer',
    min: 0,
    max: 9_007_199_254_740_991
  },
  moz_user_context: {wire_key: 'moz:userContext', required: false, primitive: 'string'},
  extensible: true
)
AutodetectProxyConfiguration =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  proxy_type: {wire_key: 'proxyType', fixed: 'autodetect'},
  extensible: true
)
DirectProxyConfiguration =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  proxy_type: {wire_key: 'proxyType', fixed: 'direct'},
  extensible: true
)
ManualProxyConfiguration =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  proxy_type: {wire_key: 'proxyType', fixed: 'manual'},
  http_proxy: {wire_key: 'httpProxy', required: false, primitive: 'string'},
  ssl_proxy: {wire_key: 'sslProxy', required: false, primitive: 'string'},
  socks_proxy: {wire_key: 'socksProxy', primitive: 'string'},
  socks_version: {wire_key: 'socksVersion', primitive: 'integer', min: 0, max: 255},
  no_proxy: {wire_key: 'noProxy', required: false, list: true, primitive: 'string'},
  extensible: true
)
SocksProxyConfiguration =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  socks_proxy: {wire_key: 'socksProxy', primitive: 'string'},
  socks_version: {wire_key: 'socksVersion', primitive: 'integer', min: 0, max: 255}
)
PacProxyConfiguration =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  proxy_type: {wire_key: 'proxyType', fixed: 'pac'},
  proxy_autoconfig_url: {wire_key: 'proxyAutoconfigUrl', primitive: 'string'},
  extensible: true
)
SystemProxyConfiguration =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  proxy_type: {wire_key: 'proxyType', fixed: 'system'},
  extensible: true
)
UserPromptHandler =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  alert: {wire_key: 'alert', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
  before_unload: {wire_key: 'beforeUnload', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
  confirm: {wire_key: 'confirm', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
  default: {wire_key: 'default', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
  file: {wire_key: 'file', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'},
  prompt: {wire_key: 'prompt', required: false, enum: 'Session::USER_PROMPT_HANDLER_TYPE'}
)
SubscribeParameters =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  events: {wire_key: 'events', list: true, primitive: 'string'},
  contexts: {wire_key: 'contexts', required: false, list: true, primitive: 'string'},
  user_contexts: {wire_key: 'userContexts', required: false, list: true, primitive: 'string'}
)
UnsubscribeByIDRequest =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  subscriptions: {wire_key: 'subscriptions', list: true, primitive: 'string'}
)
UnsubscribeByAttributesRequest =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  events: {wire_key: 'events', list: true, primitive: 'string'}
)
StatusResult =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  ready: {wire_key: 'ready', primitive: 'boolean'},
  message: {wire_key: 'message', primitive: 'string'}
)
NewParameters =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  capabilities: {wire_key: 'capabilities', ref: 'Session::CapabilitiesRequest'}
)
NewResult =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  session_id: {wire_key: 'sessionId', primitive: 'string'},
  capabilities: {wire_key: 'capabilities', ref: 'Session::CapabilityResponse'}
)
SubscribeResult =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(subscription: {wire_key: 'subscription', primitive: 'string'})
CapabilityRequestFirefoxOptions =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Serialization::Record.define(
  android_package: {wire_key: 'androidPackage', required: false, primitive: 'string'},
  android_activity: {wire_key: 'androidActivity', required: false, primitive: 'string'},
  android_device_serial: {wire_key: 'androidDeviceSerial', required: false, primitive: 'string'},
  android_intent_arguments: {
    wire_key: 'androidIntentArguments',
    required: false,
    list: true,
    primitive: 'string'
  },
  args: {wire_key: 'args', required: false, list: true, primitive: 'string'},
  binary: {wire_key: 'binary', required: false, primitive: 'string'},
  env: {wire_key: 'env', required: false, map: 'string'},
  log: {wire_key: 'log', required: false, ref: 'Session::CapabilityRequestFirefoxOptions::Log'},
  prefs: {
    wire_key: 'prefs',
    required: false,
    map: %w[string boolean integer],
    min: -9_007_199_254_740_991,
    max: 9_007_199_254_740_991
  },
  profile: {wire_key: 'profile', required: false, primitive: 'string'}
)

Instance Method Summary collapse

Methods inherited from Domain

#initialize, #remove_listener

Constructor Details

This class inherits a constructor from Selenium::WebDriver::BiDi::Protocol::Domain

Instance Method Details

#autodetect_proxy_configuration ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



307
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 307

def autodetect_proxy_configuration(**) = AutodetectProxyConfiguration.new(**)

#capabilities_request ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



304
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 304

def capabilities_request(**) = CapabilitiesRequest.new(**)

#capability_request ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



305
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 305

def capability_request(**) = CapabilityRequest.new(**)

#capability_request_firefox_options ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



315
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 315

def capability_request_firefox_options(**) = CapabilityRequestFirefoxOptions.new(**)

#capability_request_firefox_options_log ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



316
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 316

def capability_request_firefox_options_log(**) = CapabilityRequestFirefoxOptions::Log.new(**)

#direct_proxy_configuration ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



308
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 308

def direct_proxy_configuration(**) = DirectProxyConfiguration.new(**)

#end_ ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



321
322
323
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 321

def end_
  execute(cmd: 'session.end')
end

#manual_proxy_configuration ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



309
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 309

def manual_proxy_configuration(**) = ManualProxyConfiguration.new(**)

#new(capabilities:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



328
329
330
331
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 328

def new(capabilities:)
  params = NewParameters.new(capabilities: capabilities)
  execute(cmd: 'session.new', params: params, result: Session::NewResult)
end

#pac_proxy_configuration ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



310
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 310

def pac_proxy_configuration(**) = PacProxyConfiguration.new(**)

#proxy_configuration ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



306
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 306

def proxy_configuration = ProxyConfiguration

#status ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



336
337
338
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 336

def status
  execute(cmd: 'session.status', result: Session::StatusResult)
end

#subscribe(events:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



343
344
345
346
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 343

def subscribe(events:, contexts: Serialization::UNSET, user_contexts: Serialization::UNSET)
  params = SubscribeParameters.new(events: events, contexts: contexts, user_contexts: user_contexts)
  execute(cmd: 'session.subscribe', params: params, result: Session::SubscribeResult)
end

#system_proxy_configuration ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



311
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 311

def system_proxy_configuration(**) = SystemProxyConfiguration.new(**)

#unsubscribe(events: Serialization::UNSET, subscriptions: Serialization::UNSET) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



351
352
353
354
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 351

def unsubscribe(events: Serialization::UNSET, subscriptions: Serialization::UNSET)
  params = UnsubscribeParameters.build(events: events, subscriptions: subscriptions)
  execute(cmd: 'session.unsubscribe', params: params)
end

#unsubscribe_by_attributes_request ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



314
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 314

def unsubscribe_by_attributes_request(**) = UnsubscribeByAttributesRequest.new(**)

#unsubscribe_by_id_request ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



313
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 313

def unsubscribe_by_id_request(**) = UnsubscribeByIDRequest.new(**)

#user_prompt_handler ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



312
# File 'lib/selenium/webdriver/bidi/protocol/session.rb', line 312

def user_prompt_handler(**) = UserPromptHandler.new(**)