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 ⇒ 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 |
# File 'lib/selenium/webdriver/opera/service.rb', line 27 def initialize(jar, opts = {}) opts.merge! :background => true, :port => PortProber.random, :log => !!$DEBUG @server = Selenium::Server.new File.(jar), opts end |
Class Method Details
.default_service ⇒ 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 new selenium_server_jar 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.
36 37 38 39 |
# File 'lib/selenium/webdriver/opera/service.rb', line 36 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.
41 42 43 |
# File 'lib/selenium/webdriver/opera/service.rb', line 41 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.
32 33 34 |
# File 'lib/selenium/webdriver/opera/service.rb', line 32 def uri @server.webdriver_url end |