Class: Selenium::WebDriver::IE::Server Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::IE::Server
- Defined in:
- lib/selenium/webdriver/ie/server.rb
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.
Constant Summary collapse
- STOP_TIMEOUT =
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.
5
- SOCKET_LOCK_TIMEOUT =
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.
45
- MISSING_TEXT =
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.
"Unable to find standalone executable. Please download the IEDriverServer from http://selenium-release.storage.googleapis.com/index.html and place the executable on your PATH."
Instance Attribute Summary collapse
- #log_file ⇒ Object private
- #log_level ⇒ Object private
Class Method Summary collapse
- .get(opts = {}) ⇒ Object private
Instance Method Summary collapse
-
#initialize(binary_path, opts = {}) ⇒ Server
constructor
private
A new instance of Server.
- #port ⇒ Object private
- #running? ⇒ Boolean private
- #start(port, timeout) ⇒ Object private
- #stop ⇒ Object private
- #uri ⇒ Object private
Constructor Details
#initialize(binary_path, opts = {}) ⇒ Server
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.
Returns a new instance of Server.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/selenium/webdriver/ie/server.rb', line 46 def initialize(binary_path, opts = {}) Platform.assert_executable binary_path @binary_path = binary_path @process = nil opts = opts.dup @log_level = opts.delete(:log_level) @log_file = opts.delete(:log_file) @implementation = opts.delete(:implementation) unless opts.empty? raise ArgumentError, "invalid option#{'s' if opts.size != 1}: #{opts.inspect}" end end |
Instance Attribute Details
#log_file ⇒ 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.
44 45 46 |
# File 'lib/selenium/webdriver/ie/server.rb', line 44 def log_file @log_file end |
#log_level ⇒ 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.
44 45 46 |
# File 'lib/selenium/webdriver/ie/server.rb', line 44 def log_level @log_level end |
Class Method Details
.get(opts = {}) ⇒ 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.
34 35 36 37 38 39 40 41 42 |
# File 'lib/selenium/webdriver/ie/server.rb', line 34 def self.get(opts = {}) binary = IE.driver_path || Platform.find_binary("IEDriverServer") if binary new binary, opts else raise Error::WebDriverError, MISSING_TEXT end end |
Instance Method Details
#port ⇒ 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.
84 85 86 |
# File 'lib/selenium/webdriver/ie/server.rb', line 84 def port @port end |
#running? ⇒ Boolean
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.
92 93 94 |
# File 'lib/selenium/webdriver/ie/server.rb', line 92 def running? @process && @process.alive? end |
#start(port, timeout) ⇒ 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.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/selenium/webdriver/ie/server.rb', line 63 def start(port, timeout) return @port if running? @port = port socket_lock.locked do find_free_port start_process connect_until_stable(timeout) end Platform.exit_hook { stop } # make sure we don't leave the server running @port end |
#stop ⇒ 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.
78 79 80 81 82 |
# File 'lib/selenium/webdriver/ie/server.rb', line 78 def stop if running? @process.stop STOP_TIMEOUT end end |