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
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.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/selenium/webdriver/ie/server.rb', line 40 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.
38 39 40 |
# File 'lib/selenium/webdriver/ie/server.rb', line 38 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.
38 39 40 |
# File 'lib/selenium/webdriver/ie/server.rb', line 38 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.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/selenium/webdriver/ie/server.rb', line 27 def self.get(opts = {}) binary = IE.driver_path || Platform.find_binary("IEDriverServer") if binary new binary, opts else raise Error::WebDriverError, "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." 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.
82 83 84 |
# File 'lib/selenium/webdriver/ie/server.rb', line 82 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.
90 91 92 |
# File 'lib/selenium/webdriver/ie/server.rb', line 90 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.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/selenium/webdriver/ie/server.rb', line 58 def start(port, timeout) return @port if running? @port = port @process = ChildProcess.new(@binary_path, *server_args) @process.io.inherit! if $DEBUG @process.start unless SocketPoller.new(Platform.localhost, @port, timeout).connected? raise Error::WebDriverError, "unable to connect to IE server within #{timeout} seconds" end Platform.exit_hook { stop } @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.
76 77 78 79 80 |
# File 'lib/selenium/webdriver/ie/server.rb', line 76 def stop if running? @process.stop STOP_TIMEOUT end end |