Module: Selenium::Client::Protocol
- Included in:
- Base
- Defined in:
- rb/lib/selenium/client/protocol.rb
Overview
Module in charge of handling Selenium over-the-wire HTTP protocol
Instance Attribute Summary (collapse)
-
- (Object) session_id
readonly
Returns the value of attribute session_id.
Instance Method Summary (collapse)
- - (Object) boolean_array_command(verb, args)
- - (Object) boolean_command(verb, args = [])
- - (Object) number_array_command(verb, args)
- - (Object) number_command(verb, args)
- - (Object) remote_control_command(verb, args = [])
- - (Object) string_array_command(verb, args = [])
- - (Object) string_command(verb, args = [])
Instance Attribute Details
- (Object) session_id (readonly)
Returns the value of attribute session_id
8 9 10 |
# File 'rb/lib/selenium/client/protocol.rb', line 8 def session_id @session_id end |
Instance Method Details
- (Object) boolean_array_command(verb, args)
59 60 61 |
# File 'rb/lib/selenium/client/protocol.rb', line 59 def boolean_array_command(verb, args) string_array_command(verb, args).collect {|value| parse_boolean_value(value)} end |
- (Object) boolean_command(verb, args = [])
55 56 57 |
# File 'rb/lib/selenium/client/protocol.rb', line 55 def boolean_command(verb, args=[]) parse_boolean_value string_command(verb, args) end |
- (Object) number_array_command(verb, args)
51 52 53 |
# File 'rb/lib/selenium/client/protocol.rb', line 51 def number_array_command(verb, args) string_array_command verb, args end |
- (Object) number_command(verb, args)
47 48 49 |
# File 'rb/lib/selenium/client/protocol.rb', line 47 def number_command(verb, args) string_command verb, args end |
- (Object) remote_control_command(verb, args = [])
10 11 12 13 14 15 16 |
# File 'rb/lib/selenium/client/protocol.rb', line 10 def remote_control_command(verb, args=[]) timeout(@default_timeout_in_seconds) do status, response = http_post(http_request_for(verb, args)) raise CommandError, response unless status == "OK" response[3..-1] # strip "OK," from response end end |
- (Object) string_array_command(verb, args = [])
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'rb/lib/selenium/client/protocol.rb', line 22 def string_array_command(verb, args=[]) csv = string_command(verb, args) token = "" tokens = [] escape = false csv.split(//).each do |letter| if escape token += letter escape = false next end case letter when '\\' escape = true when ',' tokens << token token = "" else token += letter end end tokens << token return tokens end |
- (Object) string_command(verb, args = [])
18 19 20 |
# File 'rb/lib/selenium/client/protocol.rb', line 18 def string_command(verb, args=[]) remote_control_command(verb, args) end |