Class: Selenium::WebDriver::Opera::Service Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Opera::Service
- 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
- .default_service(opts = {}) ⇒ Object private
- .selenium_server_jar ⇒ Object private
- .selenium_server_jar=(path) ⇒ Object private
Instance Method Summary collapse
-
#initialize(jar, opts = {}) ⇒ Service
constructor
private
A new instance of Service.
- #start ⇒ Object private
- #stop ⇒ Object private
- #uri ⇒ Object private
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.(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_jar ⇒ 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.
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
#start ⇒ 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.
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 |
#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.
42 43 44 |
# File 'lib/selenium/webdriver/opera/service.rb', line 42 def stop @server.stop end |
#uri ⇒ 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.
33 34 35 |
# File 'lib/selenium/webdriver/opera/service.rb', line 33 def uri @server.webdriver_url end |