Module: SeleniumHelper
- Defined in:
- lib/selenium-client.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
1749 1750 1751 1752 1753 1754 1755 |
# File 'lib/selenium-client.rb', line 1749 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
1734 1735 1736 |
# File 'lib/selenium-client.rb', line 1734 def open(addr) @selenium.open(addr) end |
#select(inputLocator, optionLocator) ⇒ Object
Overrides standard “select” method with @selenium.select
1744 1745 1746 |
# File 'lib/selenium-client.rb', line 1744 def select(inputLocator, optionLocator) @selenium.select(inputLocator, optionLocator) end |
#type(inputLocator, value) ⇒ Object
Overrides standard “type” method with @selenium.type
1739 1740 1741 |
# File 'lib/selenium-client.rb', line 1739 def type(inputLocator, value) @selenium.type(inputLocator, value) end |