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

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



1682
1683
1684
1685
1686
1687
1688
# File 'lib/selenium/openqa/selenium.rb', line 1682

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



1667
1668
1669
# File 'lib/selenium/openqa/selenium.rb', line 1667

def open(addr)
  @selenium.open(addr)
end

#select(inputLocator, optionLocator) ⇒ Object

Overrides standard “select” method with @selenium.select



1677
1678
1679
# File 'lib/selenium/openqa/selenium.rb', line 1677

def select(inputLocator, optionLocator)
  @selenium.select(inputLocator, optionLocator)
end

#type(inputLocator, value) ⇒ Object

Overrides standard “type” method with @selenium.type



1672
1673
1674
# File 'lib/selenium/openqa/selenium.rb', line 1672

def type(inputLocator, value)
  @selenium.type(inputLocator, value)
end