Skip to main content

ForceTouch

Description 

Simulates force touch on an element.

info

Supported only in iOS Device

Parameters

NameValueDescription
ZoneString with one of the following values



* NATIVE

* WEB

* TEXT
Zones which define the way the element will be identified.
ElementStringSelect Element
IndexIntegerElement index
DurationIntegerDuration of the peek (click) action in milliseconds.
ForceIntegerForce level - percent (100% - Max force) - relevant for instrumented applications.
DragDistanceXIntegerHorizontal distance of drag, starting from the Element Coordinates.
DragDistanceYIntegerVertical distance of drag, starting from the Element Coordinates.
DragDurationIntegerDuration of the pop (drag) action in milliseconds.

Usage

Command can be used to force touch an element.

info

Replace <server> with the appropriate URL.

Example

This example demonstrates how to perform the peek and pop event on the medium button, we will use 100% force level for the peek and then drag up the element to expose the actions dialog.

To drag up we will set 'DragDistanceY' to '-250'.

**

**

ForceTouch

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

...
...
//Force touch on Element accessibilityLabel=ExperiTest
seetest.forceTouch("NATIVE", "accessibilityLabel=ExperiTest", 0, 100, 100, 0, -250, 1500);