ISelenium GetCursorPosition Method WebDriver
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 OnlineSEL-243.

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

Namespace: Selenium
Assembly: ThoughtWorks.Selenium.Core (in ThoughtWorks.Selenium.Core.dll) Version: 2.35.0.0 (2.35.0.0)
Syntax

decimal GetCursorPosition(
	string locator
)

Parameters

locator
Type: OnlineSystem String
an element locator pointing to an input element or textarea

Return Value

the numerical position of the cursor in the field
See Also