Module: SeleniumHelper
- Defined in:
- lib/selenium/openqa/selenium.rb
Overview
Defines a mixin module that you can use to write Selenium tests without typing “@selenium.” in front of every command. Every call to a missing method will be automatically sent to the @selenium object.
Instance Method Summary collapse
-
#method_missing(method_name, *args) ⇒ Object
Passes all calls to missing methods to @selenium.
-
#open(addr) ⇒ Object
Overrides standard “open” method with @selenium.open.
-
#select(inputLocator, optionLocator) ⇒ Object
Overrides standard “select” method with @selenium.select.
-
#type(inputLocator, value) ⇒ Object
Overrides standard “type” method with @selenium.type.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
Passes all calls to missing methods to @selenium
1507 1508 1509 1510 1511 1512 1513 |
# File 'lib/selenium/openqa/selenium.rb', line 1507 def method_missing(method_name, *args) if args.empty? @selenium.send(method_name) else @selenium.send(method_name, *args) end end |
Instance Method Details
#open(addr) ⇒ Object
Overrides standard “open” method with @selenium.open
1492 1493 1494 |
# File 'lib/selenium/openqa/selenium.rb', line 1492 def open(addr) @selenium.open(addr) end |
#select(inputLocator, optionLocator) ⇒ Object
Overrides standard “select” method with @selenium.select
1502 1503 1504 |
# File 'lib/selenium/openqa/selenium.rb', line 1502 def select(inputLocator, optionLocator) @selenium.select(inputLocator, optionLocator) end |
#type(inputLocator, value) ⇒ Object
Overrides standard “type” method with @selenium.type
1497 1498 1499 |
# File 'lib/selenium/openqa/selenium.rb', line 1497 def type(inputLocator, value) @selenium.type(inputLocator, value) end |