CursorPosition

From STIQ

Jump to: navigation, search

storeCursorPosition ( locator, variableName )

assertCursorPosition ( locator, pattern )
assertNotCursorPosition ( locator, pattern )
verifyCursorPosition ( locator, pattern )
verifyNotCursorPosition ( locator, pattern )
waitForCursorPosition ( locator, pattern )
waitForNotCursorPosition ( locator, pattern )


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


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


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.
Personal tools
Noteworthy