Class: Selenium::WebDriver::IE::Server Private

Inherits:
Object
  • Object
show all
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
DEPRECATION_WARNING =

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.

%{warning: the IE driver is moving the a standalone executable. Please download the IEDriverServer from http://code.google.com/p/selenium/downloads/list and place the executable on your PATH.\nFalling back to bundled DLLs for now..}

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(binary_path) ⇒ 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.



20
21
22
23
24
25
# File 'lib/selenium/webdriver/ie/server.rb', line 20

def initialize(binary_path)
  Platform.assert_executable binary_path

  @binary_path = binary_path
  @process     = nil
end

Class Method Details

.getObject

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.



9
10
11
12
13
14
15
16
17
18
# File 'lib/selenium/webdriver/ie/server.rb', line 9

def self.get
  binary = Platform.find_binary("IEDriverServer")
  if binary
    new(binary)
  else
    warn DEPRECATION_WARNING
    require 'selenium/webdriver/ie/in_process_server'
    InProcessServer.new
  end
end

Instance Method Details

#portObject

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.



51
52
53
# File 'lib/selenium/webdriver/ie/server.rb', line 51

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.

Returns:

  • (Boolean)


59
60
61
# File 'lib/selenium/webdriver/ie/server.rb', line 59

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.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/selenium/webdriver/ie/server.rb', line 27

def start(port, timeout)
  return @port if running?

  @port = port

  @process = ChildProcess.new(@binary_path, "--port=#{@port}")
  @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

#stopObject

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.



45
46
47
48
49
# File 'lib/selenium/webdriver/ie/server.rb', line 45

def stop
  if running?
    @process.stop STOP_TIMEOUT
  end
end

#uriObject

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.



55
56
57
# File 'lib/selenium/webdriver/ie/server.rb', line 55

def uri
  "http://#{Platform.localhost}:#{port}"
end