Page tree
Skip to end of metadata
Go to start of metadata

Description 

Simulates force touch on an element.

Supported only in iOS Device

Parameters

Name

Value

Description

Zone

String with one of the following values

  • NATIVE
  • WEB
  • TEXT
Zones which define the way the element will be identified.
Element StringSelect Element
IndexIntegerElement index
DurationIntegerDuration of the peek (click) action in milliseconds.
Force

Integer

Force level - percent (100% - Max force) - relevant for instrumented applications.
DragDistanceXIntegerHorizontal distance of drag, starting from the Element Coordinates.
DragDistanceYInteger

Vertical 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.

Set Experitest Url

Please make sure you replace <EXPERITEST_URL> with appropriate URL in the code snippet below.

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("<EXPERITEST_URL>"), 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);


  • No labels