Monday 17 December 2012

Selenium Accessors Part 2

storeAttribute ( attributeLocator, variableName )
Gets the value of an element attribute. Beware of http://jira.openqa.org/browse/SEL-280, which will lead some event handlers to get null event arguments. Read the bug for more details, including a workaround.Arguments:
  • attributeLocator - an element locator followed by an
  • variableName - the name of a variable in which the result is to be stored.
Returns:
the value of the specified attribute
Related Assertions, automatically generated:
  • assertAttribute ( attributeLocator, pattern )
  • assertNotAttribute ( attributeLocator, pattern )
  • verifyAttribute ( attributeLocator, pattern )
  • verifyNotAttribute ( attributeLocator, pattern )
  • waitForAttribute ( attributeLocator, pattern )
  • waitForNotAttribute ( attributeLocator, pattern )

storeAttributeFromAllWindows ( attributeName, variableName )
Returns every instance of some attribute from all known windows.Arguments:
  • attributeName - name of an attribute on the windows
  • variableName - the name of a variable in which the result is to be stored.
Returns:
the set of values of this attribute from all known windows.
Related Assertions, automatically generated:
  • assertAttributeFromAllWindows ( attributeName, pattern )
  • assertNotAttributeFromAllWindows ( attributeName, pattern )
  • verifyAttributeFromAllWindows ( attributeName, pattern )
  • verifyNotAttributeFromAllWindows ( attributeName, pattern )
  • waitForAttributeFromAllWindows ( attributeName, pattern )
  • waitForNotAttributeFromAllWindows ( attributeName, pattern )

storeBodyText ( variableName )
Gets the entire text of the page.
Returns:
the entire text of the page
Related Assertions, automatically generated:

storeConfirmation ( variableName )
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 chooseCancelOnNextConfirmation command. If an 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.
Returns:
the message of the most recent JavaScript confirmation dialog
Related Assertions, automatically generated:

storeCookie ( variableName )
Return all cookies of the current page under test.
Returns:
all cookies of the current page under test
Related Assertions, automatically generated:

storeCursorPosition ( locator, variableName )
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243.
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.Arguments:
  • locator - an element locator pointing to an input element or textarea
  • variableName - the name of a variable in which the result is to be stored.
Returns:
the numerical position of the cursor in the field
Related Assertions, automatically generated:
  • assertCursorPosition ( locator, pattern )
  • assertNotCursorPosition ( locator, pattern )
  • verifyCursorPosition ( locator, pattern )
  • verifyNotCursorPosition ( locator, pattern )
  • waitForCursorPosition ( locator, pattern )
  • waitForNotCursorPosition ( locator, pattern )

storeElementHeight ( locator, variableName )
Retrieves the height of an elementArguments:
  • locator - an element locator pointing to an element
  • variableName - the name of a variable in which the result is to be stored.
Returns:
height of an element in pixels
Related Assertions, automatically generated:
  • assertElementHeight ( locator, pattern )
  • assertNotElementHeight ( locator, pattern )
  • verifyElementHeight ( locator, pattern )
  • verifyNotElementHeight ( locator, pattern )
  • waitForElementHeight ( locator, pattern )
  • waitForNotElementHeight ( locator, pattern )

storeElementIndex ( locator, variableName )
Get the relative index of an element to its parent (starting from 0). The comment node and empty text node will be ignored.Arguments:
  • locator - an element locator pointing to an element
  • variableName - the name of a variable in which the result is to be stored.
Returns:
of relative index of the element to its parent (starting from 0)
Related Assertions, automatically generated:
  • assertElementIndex ( locator, pattern )
  • assertNotElementIndex ( locator, pattern )
  • verifyElementIndex ( locator, pattern )
  • verifyNotElementIndex ( locator, pattern )
  • waitForElementIndex ( locator, pattern )
  • waitForNotElementIndex ( locator, pattern )

No comments:

Post a Comment