Module SeleniumOnRails::TestBuilderAccessors
In: lib/selenium_on_rails/test_builder_accessors.rb

The accessors available for SeleniumOnRails::TestBuilder tests.

For each store_foo there‘s assert_foo, assert_not_foo, verify_foo, verify_not_foo, wait_for_foo, wait_for_not_foo.

Methods

Public Instance methods

Gets the absolute URL of the current page.

Related Assertions, automatically generated:

  • assert_absolute_location(pattern)
  • assert_not_absolute_location(pattern)
  • verify_absolute_location_present(pattern)
  • verify_not_absolute_location(pattern)
  • wait_for_absolute_location(pattern)
  • wait_for_not_absolute_location(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 246
246:   def store_absolute_location variable_name
247:     command 'storeAbsoluteLocation', variable_name
248:   end

Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.

Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not get/verify it, the next Selenium action will fail.

NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert dialog.

NOTE: Selenium does NOT support JavaScript alerts that are generated in a page‘s onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.

Related Assertions, automatically generated:

  • assert_alert(pattern)
  • assert_not_alert(pattern)
  • verify_alert_present(pattern)
  • verify_not_alert(pattern)
  • wait_for_alert(pattern)
  • wait_for_not_alert(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 183
183:   def store_alert variable_name
184:     command 'storeAlert', variable_name
185:   end

Has an alert occurred?

Related Assertions, automatically generated:

  • assert_alert_present
  • assert_alert_not_present
  • verify_alert_present
  • verify_alert_not_present
  • wait_for_alert_present
  • wait_for_alert_not_present

[Source]

    # File lib/selenium_on_rails/test_builder_accessors.rb, line 89
89:   def store_alert_present variable_name
90:     command 'storeAlertPresent', variable_name
91:   end

Returns the IDs of all buttons on the page.

If a given button has no ID, it will appear as "" in this array.

The pattern for the automatically generated assertions can either take an array or a pattern.

 assert_all_buttons ['but1', 'but2']
 assert_all_buttons 'but?,but?*'

Related Assertions, automatically generated:

  • assert_all_buttons(pattern)
  • assert_not_all_buttons(pattern)
  • verify_all_buttons(pattern)
  • verify_not_all_buttons(pattern)
  • wait_for_all_buttons(pattern)
  • wait_for_not_all_buttons(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 754
754:   def store_all_buttons variable_name
755:     command 'storeAllButtons', variable_name
756:   end

Returns the IDs of all input fields on the page.

If a given field has no ID, it will appear as "" in this array.

The pattern for the automatically generated assertions can either take an array or a pattern.

 assert_all_fields ['field1', 'field2']
 assert_all_fields 'field?,field?*'

Related Assertions, automatically generated:

  • assert_all_fields(pattern)
  • assert_not_all_fields(pattern)
  • verify_all_fields(pattern)
  • verify_not_all_fields(pattern)
  • wait_for_all_fields(pattern)
  • wait_for_not_all_fields(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 794
794:   def store_all_fields variable_name
795:     command 'storeAllFields', variable_name
796:   end

Returns the IDs of all links on the page.

If a given link has no ID, it will appear as "" in this array.

The pattern for the automatically generated assertions can either take an array or a pattern.

 assert_all_links ['link1', 'link2']
 assert_all_links 'link?,link?*'

Related Assertions, automatically generated:

  • assert_all_links(pattern)
  • assert_not_all_links(pattern)
  • verify_all_links(pattern)
  • verify_not_all_links(pattern)
  • wait_for_all_links(pattern)
  • wait_for_not_all_links(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 774
774:   def store_all_links variable_name
775:     command 'storeAllLinks', variable_name
776:   end

Returns the IDs of all windows that the browser knows about.

Related Assertions, automatically generated:

  • assertAllWindowIds(pattern)
  • assertNotAllWindowIds(pattern)
  • verifyAllWindowIds(pattern)
  • verifyNotAllWindowIds(pattern)
  • waitForAllWindowIds(pattern)
  • waitForNotAllWindowIds(pattern)

[Source]

    # File lib/selenium_on_rails/test_builder_accessors.rb, line 50
50:   def store_all_window_ids variable_name
51:     command 'storeAllWindowIds', variable_name
52:   end

Returns the names of all windows that the browser knows about.

Related Assertions, automatically generated:

  • assertAllWindowNames(pattern)
  • assertNotAllWindowNames(pattern)
  • verifyAllWindowNames(pattern)
  • verifyNotAllWindowNames(pattern)
  • waitForAllWindowNames(pattern)
  • waitForNotAllWindowNames(pattern)

[Source]

    # File lib/selenium_on_rails/test_builder_accessors.rb, line 63
63:   def store_all_window_names variable_name
64:     command 'storeAllWindowNames', variable_name
65:   end

Returns the titles of all windows that the browser knows about.

Related Assertions, automatically generated:

  • assertAllWindowTitles(pattern)
  • assertNotAllWindowTitles(pattern)
  • verifyAllWindowTitles(pattern)
  • verifyNotAllWindowTitles(pattern)
  • waitForAllWindowTitles(pattern)
  • waitForNotAllWindowTitles(pattern)

[Source]

    # File lib/selenium_on_rails/test_builder_accessors.rb, line 76
76:   def store_all_window_titles variable_name
77:     command 'storeAllWindowTitles', variable_name
78:   end

Gets the value of an element attribute.

Related Assertions, automatically generated:

  • assert_attribute(locator, attribute_name, pattern)
  • assert_not_attribute(locator, attribute_name, pattern)
  • verify_attribute_present(locator, attribute_name, pattern)
  • verify_not_attribute(locator, attribute_name, pattern)
  • wait_for_attribute(locator, attribute_name, pattern)
  • wait_for_not_attribute(locator, attribute_name, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 577
577:   def store_attribute locator, attribute_name, variable_name
578:     command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name
579:   end

Returns every instance of some attribute from all known windows.

Related Assertions, automatically generated:

  • assert_attribute_from_all_windows(attribute_name, pattern)
  • assert_not_attribute_from_all_windows(attribute_name, pattern)
  • verify_attribute_from_all_windows(attribute_name, pattern)
  • verify_not_attribute_from_all_windows(attribute_name, pattern)
  • wait_for_attribute_from_all_windows(attribute_name, pattern)
  • wait_for_not_attribute_from_all_windows(attribute_name, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 102
102:   def store_attribute_from_all_windows attribute_name, variable_name
103:     command 'storeAttributeFromAllWindows', attribute_name, variable_name
104:   end

Gets the entire text of the page.

Related Assertions, automatically generated:

  • assert_body_text(pattern)
  • assert_not_body_text(pattern)
  • verify_body_text_present(pattern)
  • verify_not_body_text(pattern)
  • wait_for_body_text(pattern)
  • wait_for_not_body_text(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 300
300:   def store_body_text variable_name
301:     command 'storeBodyText', variable_name
302:   end

Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn‘t exist or isn‘t a toggle-button.

Related Assertions, automatically generated:

  • assert_checked(locator)
  • assert_not_checked(locator)
  • verify_checked_present(locator)
  • verify_not_checked(locator)
  • wait_for_checked(locator)
  • wait_for_not_checked(locator)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 370
370:   def store_checked locator, variable_name
371:     command 'storeChecked', locator, variable_name
372:   end

Retrieves the message of a JavaScript confirmation dialog generated during the previous action.

By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the choose_cancel_on_next_confirmation command. If a confirmation is generated but you do not get/verify it, the next Selenium action will fail.

NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog.

NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page‘s onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK.

Related Assertions, automatically generated:

  • assert_confirmation(pattern)
  • assert_not_confirmation(pattern)
  • verify_confirmation_present(pattern)
  • verify_not_confirmation(pattern)
  • wait_for_confirmation(pattern)
  • wait_for_not_confirmation(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 209
209:   def store_confirmation variable_name
210:     command 'storeConfirmation', variable_name
211:   end

Has confirm() been called?

Related Assertions, automatically generated:

  • assert_confirmation_present
  • assert_confirmation_not_present
  • verify_confirmation_present
  • verify_confirmation_not_present
  • wait_for_confirmation_present
  • wait_for_confirmation_not_present

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 128
128:   def store_confirmation_present variable_name
129:     command 'storeConfirmationPresent', variable_name
130:   end

Return all cookies of the current page under test.

Related Assertions, automatically generated:

  • assert_cookie(pattern)
  • assert_not_cookie(pattern)
  • verify_cookie(pattern)
  • verify_not_cookie(pattern)
  • wait_for_cookie(pattern)
  • wait_for_not_cookie(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 141
141:   def store_cookie variable_name
142:     command 'storeCookie', variable_name
143:   end

Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.

This method will fail if the specified element isn‘t an input element or textarea, or there is no cursor in the element.

Related Assertions, automatically generated:

  • assert_cursor_position(locator, pattern)
  • assert_not_cursor_position(locator, pattern)
  • verify_cursor_position(locator, pattern)
  • verify_not_cursor_position(locator, pattern)
  • wait_for_cursor_position(locator, pattern)
  • wait_for_not_cursor_position(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 158
158:   def store_cursor_position locator, variable_name
159:     command 'storeCursorPosition', locator, variable_name
160:   end

Determines whether the specified input element is editable, i.e. hasn‘t been disabled. This method will fail if the specified element isn‘t an input element.

Related Assertions, automatically generated:

  • assert_editable(locator)
  • assert_not_editable(locator)
  • verify_editable(locator)
  • verify_not_editable(locator)
  • wait_for_editable(locator)
  • wait_for_not_editable(locator)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 734
734:   def store_editable locator, variable_name
735:     command 'storeEditable', locator, variable_name
736:   end

Retrieves the height of an element. This method will fail if the element is not present.

Related Assertions, automatically generated:

  • assert_element_height(locator, pattern)
  • assert_not_element_height(locator, pattern)
  • verify_element_height(locator, pattern)
  • verify_not_element_height(locator, pattern)
  • wait_for_element_height(locator, pattern)
  • wait_for_not_element_height(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 650
650:   def store_element_height locator, variable_name
651:     command 'storeElementHeight', locator, variable_name
652:   end

Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored.

Related Assertions, automatically generated:

  • assert_element_index(locator, pattern)
  • assert_not_element_index(locator, pattern)
  • verify_element_index(locator, pattern)
  • verify_not_element_index(locator, pattern)
  • wait_for_element_index(locator, pattern)
  • wait_for_not_element_index(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 664
664:   def store_element_index locator, variable_name
665:     command 'storeElementIndex', locator, variable_name
666:   end

Retrieves the horizontal position of an element. This method will fail if the element is not present.

Related Assertions, automatically generated:

  • assert_element_position_left(locator, pattern)
  • assert_not_element_position_left(locator, pattern)
  • verify_element_position_left(locator, pattern)
  • verify_not_element_position_left(locator, pattern)
  • wait_for_element_position_left(locator, pattern)
  • wait_for_not_element_position_left(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 692
692:   def store_element_position_left locator, variable_name
693:     command 'storeElementPositionLeft', locator, variable_name
694:   end

Retrieves the vertical position of an element. This method will fail if the element is not present.

Related Assertions, automatically generated:

  • assert_element_position_top(locator, pattern)
  • assert_not_element_position_top(locator, pattern)
  • verify_element_position_top(locator, pattern)
  • verify_not_element_position_top(locator, pattern)
  • wait_for_element_position_top(locator, pattern)
  • wait_for_not_element_position_top(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 706
706:   def store_element_position_top locator, variable_name
707:     command 'storeElementPositionTop', locator, variable_name
708:   end

Verifies that the specified element is somewhere on the page.

Related Assertions, automatically generated:

  • assert_element_present(locator)
  • assert_element_not_present(locator)
  • verify_element_present(locator)
  • verify_element_not_present(locator)
  • wait_for_element_present(locator)
  • wait_for_element_not_present(locator)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 620
620:   def store_element_present locator, variable_name
621:     command 'storeElementPresent', locator, variable_name
622:   end

Retrieves the width of an element. This method will fail if the element is not present.

Related Assertions, automatically generated:

  • assert_element_width(locator, pattern)
  • assert_not_element_width(locator, pattern)
  • verify_element_width(locator, pattern)
  • verify_not_element_width(locator, pattern)
  • wait_for_element_width(locator, pattern)
  • wait_for_not_element_width(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 678
678:   def store_element_width locator, variable_name
679:     command 'storeElementWidth', locator, variable_name
680:   end

Tell Selenium to expect an error on the next command execution.

NOTE: store_error_on_next is currently not supported by Selenium Core and is only added to here as a shortcut for generating the related assertions.

Related Assertions, automatically generated:

  • assert_error_on_next(message)
  • assert_not_error_on_next(message)
  • verify_error_on_next(message)
  • verify_not_error_on_next(message)
  • wait_for_error_on_next(message)
  • wait_for_not_error_on_next(message)

[Source]

    # File lib/selenium_on_rails/test_builder_accessors.rb, line 20
20:   def store_error_on_next message
21:     raise 'Not supported in Selenium Core at the moment'
22:   end

Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.

Note that, by default, the snippet will run in the context of the "selenium" object itself, so this will refer to the Selenium object, and window will refer to the top-level runner test window, not the window of your application.

If you need a reference to the window of your application, you can refer to this.browserbot.getCurrentWindow() and if you need to use a locator to refer to a single element in your application page, you can use this.page().findElement("foo") where "foo" is your locator.

Related Assertions, automatically generated:

  • assert_eval(script, pattern)
  • assert_not_eval(script, pattern)
  • verify_eval_present(script, pattern)
  • verify_not_eval(script, pattern)
  • wait_for_eval(script, pattern)
  • wait_for_not_eval(script, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 356
356:   def store_eval script, variable_name
357:     command 'storeEval', script, variable_name
358:   end

Returns the specified expression.

This is useful because of JavaScript preprocessing.

Related Assertions, automatically generated:

  • assert_expression(expression, pattern)
  • assert_not_expression(expression, pattern)
  • verify_expression(expression, pattern)
  • verify_not_expression(expression, pattern)
  • wait_for_expression(expression, pattern)
  • wait_for_not_expression(expression, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 822
822:   def store_expression expression, variable_name
823:     command 'storeExpression', expression, variable_name
824:   end

Tell Selenium to expect a failure on the next command execution.

NOTE: store_failure_on_next is currently not supported by Selenium Core and is only added to here as a shortcut for generating the related assertions.

Related Assertions, automatically generated:

  • assert_failure_on_next(message)
  • assert_not_failure_on_next(message)
  • verify_failure_on_next(message)
  • verify_not_failure_on_next(message)
  • wait_for_failure_on_next(message)
  • wait_for_not_failure_on_next(message)

[Source]

    # File lib/selenium_on_rails/test_builder_accessors.rb, line 37
37:   def store_failure_on_next message
38:     raise 'Not supported in Selenium Core at the moment'
39:   end

Returns the entire HTML source between the opening and closing "html" tags.

Related Assertions, automatically generated:

  • assert_html_source(pattern)
  • assert_not_html_source(pattern)
  • verify_html_source(pattern)
  • verify_not_html_source(pattern)
  • wait_for_html_source(pattern)
  • wait_for_not_html_source(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 807
807:   def store_html_source variable_name
808:     command 'storeHtmlSource', variable_name
809:   end

Verify the location of the current page ends with the expected location. If an URL querystring is provided, this is checked as well.

Related Assertions, automatically generated:

  • assert_location(pattern)
  • assert_not_location(pattern)
  • verify_location_present(pattern)
  • verify_not_location(pattern)
  • wait_for_location(pattern)
  • wait_for_not_location(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 260
260:   def store_location expected_location, variable_name
261:     command 'storeLocation', expected_location, variable_name
262:   end

Return the contents of the log.

Related Assertions, automatically generated:

  • assert_log_messages(pattern)
  • assert_not_log_messages(pattern)
  • verify_log_messages(pattern)
  • verify_not_log_messages(pattern)
  • wait_for_log_messages(pattern)
  • wait_for_not_log_messages(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 719
719:   def store_log_messages variable_name
720:     command 'storeLogMessages', variable_name
721:   end

Returns the number of pixels between "mousemove" events during drag_and_drop commands (default=10).

Related Assertions, automatically generated:

  • assert_mouse_speed(pattern)
  • assert_not_mouse_speed(pattern)
  • verify_mouse_speed(pattern)
  • verify_not_mouse_speed(pattern)
  • wait_for_mouse_speed(pattern)
  • wait_for_not_mouse_speed(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 274
274:   def store_mouse_speed variable_name
275:     command 'storeMouseSpeed', variable_name
276:   end

Check if these two elements have same parent and are ordered. Two same elements will not be considered ordered.

NOTE: store_ordered is currently not supported by Selenium Core.

Related Assertions, automatically generated:

  • assert_ordered(locator_1, locator_2)
  • assert_not_ordered(locator_1, locator_2)
  • verify_ordered(locator_1, locator_2)
  • verify_not_ordered(locator_1, locator_2)
  • wait_for_ordered(locator_1, locator_2)
  • wait_for_not_ordered(locator_1, locator_2)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 593
593:   def store_ordered locator_1, locator_2, variable_name
594:     raise 'Not supported in Selenium Core at the moment'
595:   end

Retrieves the message of a JavaScript question prompt dialog generated during the previous action.

Successful handling of the prompt requires prior execution of the answer_on_next_prompt command. If a prompt is generated but you do not get/verify it, the next Selenium action will fail.

NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog.

NOTE: Selenium does NOT support JavaScript prompts that are generated in a page‘s onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK.

Related Assertions, automatically generated:

  • assert_prompt(pattern)
  • assert_not_prompt(pattern)
  • verify_prompt_present(pattern)
  • verify_not_prompt(pattern)
  • wait_for_prompt(pattern)
  • wait_for_not_prompt(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 233
233:   def store_prompt variable_name
234:     command 'storePrompt', variable_name
235:   end

Has a prompt occurred?

Related Assertions, automatically generated:

  • assert_prompt_present
  • assert_prompt_not_present
  • verify_prompt_present
  • verify_prompt_not_present
  • wait_for_prompt_present
  • wait_for_prompt_not_present

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 115
115:   def store_prompt_present variable_name
116:     command 'storePromptPresent', variable_name
117:   end

Gets all option labels in the specified select drop-down.

The pattern for the automatically generated assertions can either take an array or a pattern.

 assert_select_options 'fruits', ['apple', 'pear']
 assert_select_options 'fruits', 'a*,p*'

Related Assertions, automatically generated:

  • assert_select_options(locator, pattern)
  • assert_not_select_options(locator, pattern)
  • verify_select_options_present(locator, pattern)
  • verify_not_select_options(locator, pattern)
  • wait_for_select_options(locator, pattern)
  • wait_for_not_select_options(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 564
564:   def store_select_options locator, variable_name
565:     command 'storeSelectOptions', locator, variable_name
566:   end

Verifies that the selected option of a drop-down satisfies the option_locator.

option_locator is typically just an option label (e.g. "John Smith").

See the select command for more information about option locators.

NOTE: store_selected is currently not supported by Selenium Core.

Related Assertions, automatically generated:

  • assert_selected(locator, option_locator)
  • assert_not_selected(locator, option_locator)
  • verify_selected_present(locator, option_locator)
  • verify_not_selected(locator, option_locator)
  • wait_for_selected(locator, option_locator)
  • wait_for_not_selected(locator, option_locator)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 403
403:   def store_selected locator, option_locator, variable_name
404:     raise 'Not supported in Selenium Core at the moment'
405:   end

Gets option element ID for selected option in the specified select element.

Related Assertions, automatically generated:

  • assert_selected_id(select_locator, pattern)
  • assert_not_selected_id(select_locator, pattern)
  • verify_selected_id(select_locator, pattern)
  • verify_not_selected_id(select_locator, pattern)
  • wait_for_selected_id(select_locator, pattern)
  • wait_for_not_selected_id(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 416
416:   def store_selected_id select_locator, variable_name
417:     command 'storeSelectedId', select_locator, variable_name
418:   end

Gets all option element IDs for selected options in the specified select or multi-select element.

Related Assertions, automatically generated:

  • assert_selected_ids(select_locator, pattern)
  • assert_not_selected_ids(select_locator, pattern)
  • verify_selected_ids(select_locator, pattern)
  • verify_not_selected_ids(select_locator, pattern)
  • wait_for_selected_ids(select_locator, pattern)
  • wait_for_not_selected_ids(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 430
430:   def store_selected_ids select_locator, variable_name
431:     command 'storeSelectedIds', select_locator, variable_name
432:   end

Gets option index (option number, starting at 0) for selected option in the specified select element.

Related Assertions, automatically generated:

  • assert_selected_index(select_locator, pattern)
  • assert_not_selected_index(select_locator, pattern)
  • verify_selected_index(select_locator, pattern)
  • verify_not_selected_index(select_locator, pattern)
  • wait_for_selected_index(select_locator, pattern)
  • wait_for_not_selected_index(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 444
444:   def store_selected_index select_locator, variable_name
445:     command 'storeSelectedIndex', select_locator, variable_name
446:   end

Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.

Related Assertions, automatically generated:

  • assert_selected_indexes(select_locator, pattern)
  • assert_not_selected_indexes(select_locator, pattern)
  • verify_selected_indexes(select_locator, pattern)
  • verify_not_selected_indexes(select_locator, pattern)
  • wait_for_selected_indexes(select_locator, pattern)
  • wait_for_not_selected_indexes(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 458
458:   def store_selected_indexes select_locator, variable_name
459:     command 'storeSelectedIndexes', select_locator, variable_name
460:   end

Gets option label (visible text) for selected option in the specified select element.

Related Assertions, automatically generated:

  • assert_selected_label(select_locator, pattern)
  • assert_not_selected_label(select_locator, pattern)
  • verify_selected_label(select_locator, pattern)
  • verify_not_selected_label(select_locator, pattern)
  • wait_for_selected_label(select_locator, pattern)
  • wait_for_not_selected_label(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 472
472:   def store_selected_label select_locator, variable_name
473:     command 'storeSelectedLabel', select_locator, variable_name
474:   end

Gets all option labels (visible text) for selected options in the specified select or multi-select element.

Related Assertions, automatically generated:

  • assert_selected_labels(select_locator, pattern)
  • assert_not_selected_labels(select_locator, pattern)
  • verify_selected_labels(select_locator, pattern)
  • verify_not_selected_labels(select_locator, pattern)
  • wait_for_selected_labels(select_locator, pattern)
  • wait_for_not_selected_labels(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 486
486:   def store_selected_labels select_locator, variable_name
487:     command 'storeSelectedLabels', select_locator, variable_name
488:   end

Gets all option labels for selected options in the specified select or multi-select element.

The pattern for the automatically generated assertions can either take an array or a pattern.

 assert_selected_options 'fruits', ['apple', 'pear']
 assert_selected_options 'fruits', 'a*,p*'

Related Assertions, automatically generated:

  • assert_selected_options(locator, pattern)
  • assert_not_selected_options(locator, pattern)
  • verify_selected_options_present(locator, pattern)
  • verify_not_selected_options(locator, pattern)
  • wait_for_selected_options(locator, pattern)
  • wait_for_not_selected_options(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 546
546:   def store_selected_options locator, variable_name
547:     command 'storeSelectedOptions', locator, variable_name
548:   end

Gets option value (value attribute) for selected option in the specified select element.

Related Assertions, automatically generated:

  • assert_selected_value(select_locator, pattern)
  • assert_not_selected_value(select_locator, pattern)
  • verify_selected_value(select_locator, pattern)
  • verify_not_selected_value(select_locator, pattern)
  • wait_for_selected_value(select_locator, pattern)
  • wait_for_not_selected_value(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 500
500:   def store_selected_value select_locator, variable_name
501:     command 'storeSelectedValue', select_locator, variable_name
502:   end

Gets all option values (value attribute) for selected options in the specified select or multi-select element.

Related Assertions, automatically generated:

  • assert_selected_values(select_locator, pattern)
  • assert_not_selected_values(select_locator, pattern)
  • verify_selected_values(select_locator, pattern)
  • verify_not_selected_values(select_locator, pattern)
  • wait_for_selected_values(select_locator, pattern)
  • wait_for_not_selected_values(select_locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 514
514:   def store_selected_values select_locator, variable_name
515:     command 'storeSelectedValues', select_locator, variable_name
516:   end

Determines whether some option in a drop-down menu is selected.

Related Assertions, automatically generated:

  • assert_something_selected(select_locator)
  • assert_not_something_selected(select_locator)
  • verify_something_selected(select_locator)
  • verify_not_something_selected(select_locator)
  • wait_for_something_selected(select_locator)
  • wait_for_not_something_selected(select_locator)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 527
527:   def store_something_selected select_locator, variable_name
528:     command 'storeSomethingSelected', select_locator, variable_name
529:   end

Gets the text from a cell of a table.

Related Assertions, automatically generated:

  • assert_table(locator, row, column, pattern)
  • assert_not_table(locator, row, column, pattern)
  • verify_table_present(locator, row, column, pattern)
  • verify_not_table(locator, row, column, pattern)
  • wait_for_table(locator, row, column, pattern)
  • wait_for_not_table(locator, row, column, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 383
383:   def store_table locator, row, column, variable_name
384:     command 'storeTable', "#{locator}.#{row}.#{column}", variable_name
385:   end

Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.

Related Assertions, automatically generated:

  • assert_text(locator, pattern)
  • assert_not_text(locator, pattern)
  • verify_text_present(locator, pattern)
  • verify_not_text(locator, pattern)
  • wait_for_text(locator, pattern)
  • wait_for_not_text(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 331
331:   def store_text locator, variable_name
332:     command 'storeText', locator, variable_name
333:   end

Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.

Related Assertions, automatically generated:

  • assert_text_present(pattern)
  • assert_text_not_present(pattern)
  • verify_text_present(pattern)
  • verify_text_not_present(pattern)
  • wait_for_text_present(pattern)
  • wait_for_text_not_present(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 607
607:   def store_text_present pattern, variable_name
608:     command 'storeTextPresent', pattern, variable_name
609:   end

Gets the title of the current page.

Related Assertions, automatically generated:

  • assert_title(pattern)
  • assert_not_title(pattern)
  • verify_title_present(pattern)
  • verify_not_title(pattern)
  • wait_for_title(pattern)
  • wait_for_not_title(pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 287
287:   def store_title variable_name
288:     command 'storeTitle', variable_name
289:   end

Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.

Related Assertions, automatically generated:

  • assert_value(locator, pattern)
  • assert_not_value(locator, pattern)
  • verify_value_present(locator, pattern)
  • verify_not_value(locator, pattern)
  • wait_for_value(locator, pattern)
  • wait_for_not_value(locator, pattern)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 315
315:   def store_value locator, variable_name
316:     command 'storeValue', locator, variable_name
317:   end

Determines if the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one if its ancestors. This method will fail if the element is not present.

Related Assertions, automatically generated:

  • assert_visible(locator)
  • assert_not_visible(locator)
  • verify_visible(locator)
  • verify_not_visible(locator)
  • wait_for_visible(locator)
  • wait_for_not_visible(locator)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 636
636:   def store_visible locator, variable_name
637:     command 'storeVisible', locator, variable_name
638:   end

Determine whether current/locator identify the frame containing this running code.

This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" frame. In this case, when the test calls select_frame, this routine is called for each frame to figure out which one has been selected. The selected frame will return true, while all others will return false.

NOTE: store_whether_this_frame_match_frame_expression is currently not supported by Selenium Core.

Related Assertions, automatically generated:

  • assert_whether_this_frame_match_frame_expression(current_frame_string, target)
  • assert_not_whether_this_frame_match_frame_expression(current_frame_string, target)
  • verify_whether_this_frame_match_frame_expression(current_frame_string, target)
  • verify_not_whether_this_frame_match_frame_expression(current_frame_string, target)
  • wait_for_whether_this_frame_match_frame_expression(current_frame_string, target)
  • wait_for_not_whether_this_frame_match_frame_expression(current_frame_string, target)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 846
846:   def store_whether_this_frame_match_frame_expression current_frame_string, target, variable_name
847:     raise 'Not supported in Selenium Core at the moment'
848:   end

Determine whether current_window_string plus target identify the window containing this running code.

This is useful in proxy injection mode, where this code runs in every browser frame and window, and sometimes the selenium server needs to identify the "current" window. In this case, when the test calls select_window, this routine is called for each window to figure out which one has been selected. The selected window will return true, while all others will return false.

NOTE: store_whether_this_window_match_window_expression is currently not supported by Selenium Core.

Related Assertions, automatically generated:

  • assert_whether_this_window_match_window_expression(current_window_string, target)
  • assert_not_whether_this_window_match_window_expression(current_window_string, target)
  • verify_whether_this_window_match_window_expression(current_window_string, target)
  • verify_not_whether_this_window_match_window_expression(current_window_string, target)
  • wait_for_whether_this_window_match_window_expression(current_window_string, target)
  • wait_for_not_whether_this_window_match_window_expression(current_window_string, target)

[Source]

     # File lib/selenium_on_rails/test_builder_accessors.rb, line 869
869:   def store_whether_this_window_match_window_expression current_window_string, target, variable_name
870:     raise 'Not supported in Selenium Core at the moment'
871:   end

[Validate]