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

Inherits:
Object
  • Object
show all
Defined in:
rb/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

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

- (Service) initialize(jar, opts = {})

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 'rb/lib/selenium/webdriver/opera/service.rb', line 27

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

Class Method Details

+ (Object) default_service(opts = {})

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 'rb/lib/selenium/webdriver/opera/service.rb', line 23

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

+ (Object) selenium_server_jar

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 'rb/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

+ (Object) selenium_server_jar=(path)

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 'rb/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

- (Object) start

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 'rb/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

- (Object) stop

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 'rb/lib/selenium/webdriver/opera/service.rb', line 42

def stop
  @server.stop
end

- (Object) uri

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 'rb/lib/selenium/webdriver/opera/service.rb', line 33

def uri
  @server.webdriver_url
end