123456789_123456789_123456789_123456789_123456789_

Module: Selenium::WebDriver::DriverExtensions::HasNetworkConditions Private

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#network_conditionsHash (rw)

Returns network conditions.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb', line 30

def network_conditions
  @bridge.network_conditions
end

#network_conditions=(conditions) (rw)

Sets network conditions

Parameters:

  • conditions (Hash)

Options Hash (conditions):

  • :latency (Integer)
  • :throughput (Integer)
  • :upload_throughput (Integer)
  • :download_throughput (Integer)
  • :offline (Boolean)
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb', line 45

def network_conditions=(conditions)
  conditions[:latency] ||= 0
  unless conditions.key?(:throughput)
    conditions[:download_throughput] ||= -1
    conditions[:upload_throughput] ||= -1
  end
  conditions[:offline] = false unless conditions.key?(:offline)

  @bridge.network_conditions = conditions
end

Instance Method Details

#delete_network_conditions

Resets Chromium network emulation settings.

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/driver_extensions/has_network_conditions.rb', line 60

def delete_network_conditions
  @bridge.delete_network_conditions
end