Method: SeleniumPlus::Container#element

Defined in:
lib/selenium_plus/page_obj/container.rb

#element(name, *find_args) ⇒ Selenium::WebDriver::Element

Define a new method with the name of the symbol and return an element

Examples:

class DemoPage < SeleniumPlus::Page
  element(:username_tb, :id, 'username')
end

Parameters:

  • name (Symbol)

    The name of new element

  • find_args (Array)

Returns:



16
17
18
19
20
21
# File 'lib/selenium_plus/page_obj/container.rb', line 16

def element(name, *find_args)
  define_method(name) do
    find(*find_args)
  end
  add_existence_checker(name, *find_args)
end