Scrubyt::NavigationActions

Describing actions which interact with the page

This class contains all the actions that are used to navigate on web pages; first of all, fetch for downloading the pages - then various actions like filling textfields, submitting formst, clicking links and more

Public Class Methods

extend_object(obj) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 10
def self.extend_object(obj)
  super(obj)
  obj.instance_eval do
    @current_form = nil
  end
end

Public Instance Methods

check_checkbox(checkbox_name) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 46
def check_checkbox(checkbox_name)
  FetchAction.check_checkbox(checkbox_name)
end
check_radiobutton(checkbox_name, index=0) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 50
def check_radiobutton(checkbox_name, index=0)
  FetchAction.check_radiobutton(checkbox_name, index=0)
end
click_by_xpath(xpath) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 79
def click_by_xpath(xpath)
  FetchAction.click_by_xpath(xpath)
end
click_image_map(index=0) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 83
def click_image_map(index=0)
  FetchAction.click_image_map(index)
end
fetch(*args) click to toggle source

Fetch the document

# File lib/scrubyt/core/navigation/navigation_actions.rb, line 56
def fetch(*args)
  FetchAction.fetch(*args)
end
fill_textarea(textarea_name, text) click to toggle source

Action to fill a textarea with text

# File lib/scrubyt/core/navigation/navigation_actions.rb, line 36
def fill_textarea(textarea_name, text)
  FetchAction.fill_textarea(textarea_name, text)
end
fill_textfield(textfield_name, query_string, use_value = nil) click to toggle source

Action to fill a textfield with a query string

*parameters*

textfield_name - the name of the textfield (e.g. the name of the google search textfield is 'q'

query_string - the string that should be entered into the textfield

# File lib/scrubyt/core/navigation/navigation_actions.rb, line 26
def fill_textfield(textfield_name, query_string, use_value = nil)
  FetchAction.fill_textfield(textfield_name, query_string, 0, use_value)
end
fill_textfield_and_wait(textfield_name, query_string, sleep_secs=0, use_value=nil) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 30
def fill_textfield_and_wait(textfield_name, query_string, sleep_secs=0, use_value=nil)
  FetchAction.fill_textfield(textfield_name, query_string, sleep_secs, use_value)
end
frame(attribute,value) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 87
def frame(attribute,value)
  FetchAction.frame(attribute,value)
end
select_option(selectlist_name, option) click to toggle source

Action for selecting an option from a dropdown box

# File lib/scrubyt/core/navigation/navigation_actions.rb, line 42
def select_option(selectlist_name, option)
  FetchAction.select_option(selectlist_name, option)
end
submit(index=nil, type=nil) click to toggle source

Submit the current form

# File lib/scrubyt/core/navigation/navigation_actions.rb, line 61
def submit(index=nil, type=nil)
  FetchAction.submit(nil, index, type)
end
submit_and_wait(sleep_time, index=nil, type=nil) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 65
def submit_and_wait(sleep_time, index=nil, type=nil)
  FetchAction.submit(index, sleep_time,  type)
end
wait(time=1) click to toggle source
# File lib/scrubyt/core/navigation/navigation_actions.rb, line 91
def wait(time=1)
  FetchAction.wait(time)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.