Class: Selenium::WebDriver::Opera::Service Private

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/opera/service.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

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 the Selenium server jar.  Please download the standalone server from http://code.google.com/p/selenium/downloads/list and set the SELENIUM_SERVER_JAR environmental variable to its location.  More info at http://code.google.com/p/selenium/wiki/OperaDriver.'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jar, opts = {}) ⇒ Service

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 Service.



27
28
29
30
31
# File 'lib/selenium/webdriver/opera/service.rb', line 27

def initialize(jar, opts = {})
  opts.merge! :background => true, :port => PortProber.random
  opts.merge! :log => !!$DEBUG if $DEBUG
  @server = Selenium::Server.new File.expand_path(jar), opts
end

Class Method Details

.default_service(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.



23
24
25
# File 'lib/selenium/webdriver/opera/service.rb', line 23

def self.default_service(opts = {})
  new selenium_server_jar, opts
end

.selenium_server_jarObject

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.



12
13
14
15
16
# File 'lib/selenium/webdriver/opera/service.rb', line 12

def self.selenium_server_jar
  @selenium_server_jar ||= (
    ENV['SELENIUM_SERVER_JAR'] or raise Error::WebDriverError, MISSING_TEXT
  )
end

.selenium_server_jar=(path) ⇒ 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.



18
19
20
21
# File 'lib/selenium/webdriver/opera/service.rb', line 18

def self.selenium_server_jar=(path)
  Platform.assert_file path
  @selenium_server_jar = path
end

Instance Method Details

#startObject

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.



37
38
39
40
# File 'lib/selenium/webdriver/opera/service.rb', line 37

def start
  @server.start
  Platform.exit_hook { stop }  # make sure we don't leave the server running
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.



42
43
44
# File 'lib/selenium/webdriver/opera/service.rb', line 42

def stop
  @server.stop
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.



33
34
35
# File 'lib/selenium/webdriver/opera/service.rb', line 33

def uri
  @server.webdriver_url
end