Skip to main content

LongClick

Description

Long click on or near an element or text (the proximity to the element/text is specified by an X-Y offset)

Parameters

NameValueDescription
ZoneString with one of the following values



* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
ElementStringIdentification of Element in the device screen.
Element to find indexIntegerElement to find index
Click CountIntegerNumber of clicks
Horizontal OffsetIntegerHorizontal Offset from the Element in screen pixels
Horizontal OffsetIntegerVertical Offset from the Element in screen pixels

Usage

Designed command for longer click operations (click duration is 2000 milliseconds)

info

Replace <server> with the appropriate URL.

Example

LongClick

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "<deviceid>");

...
...
// This command will look for the EriBank application in device screen at the moment and long click once.
seetest.longClick("NATIVE", "//*[@text='EriBank']", 0, 1, 0, 0);