WebDriver Mouse and Keyboard Events
WebDriver testing with Eggplant Functional and SenseTalk lets you automate actions in browsers and web apps by accessing WebElement objects (HTML elements) in the DOM of the pages you're testing. Use the commands and functions described here to perform Mouse and Keyboard events in your SenseTalk scripts based on Selenium WebDriver connections.
WebElement Identifiers
To access a WebElement within the DOM, such as when using the FindElement()
function or the Click
command with a WebDriver connection, you have several ways to specify the element you want to interact with. The following WebElement Identifiers can be used to locate elements in the DOM:
- webID: Use this property to locate an element by the value of its ID attribute.
- webName: Use this property to locate an element by the value of its Name attribute.
- webTagName: Use this property to locate an element whose HTML tag is equal to the given value.
- webClassName: Use this property to locate an element by the value of its Class attribute.
- webLinkText: Use this property to locate a link whose text is equal to the indicated value.
- webPartialLinkText: Use this property to locate a link whose text contains the indicated value.
- webCssSelector: Use this property to locate an element using the indicated CSS selector expression.
- webXPath: Use this property to locate an element by using an XPath expression. For information about XPath and XPath expressions, see XPath in Selenium WebDriver: Complete Tutorial.
WebLocation Identifier
A WebLocation Identifier is another method you can use to interact with WebElements. A WebLocation Identifier is a property list that contains objectType, x, and y properties. The objectType is always webLocation
, and the x and y properties represent the coordinates of a point on the web page. For example:
{objectType:"webLocation", x:"476", y:"83"}