Mouse Events and Control
This section describes the Eggplant Functional commands and functions that execute mouse events or return information about the mouse cursor on the SUT. Many of these commands and functions, including Click, DoubleClick, Drag, Drop, DragandDrop, MouseButtonDown, and MouseLocation(), work against mobile SUTs as well as desktop SUTs, which is helpful when creating scripts that automate both mobile and desktop platforms. SenseTalk also includes a set of mobile commands and functions, a subset of which (Tap, DoubleTap, Press, etc.) are compatible with desktop SUTs.
Click Command
This code definition explains the use of the Click command for image-based scripting. For information about using this command for WebDriver connections, see WebDriver Mouse and Keyboard Events: Click Command.
Behavior: Clicks the SUT mouse on the hot spot (Image) or center (OCR) of the first location found. If more than one image or text string is passed, Eggplant Functional searches for images in the order in which they are listed.
The Tap and Click commands perform the same event and can be used against both desktop and mobile SUTs.
Parameters: One or more Image References or Text Properties (for OCR), or a single coordinate location.
Example:
repeat with each item of ["Option1","Option2","Option3"] //Repeats through a list of images
click it//Clicks the hot spot of the current image in the list
end repeat