ForceTouch
Description
Simulates force touch on an element.
info
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 | String | Select Element |
Index | Integer | Element index |
Duration | Integer | Duration of the peek (click) action in milliseconds. |
Force | Integer | Force level - percent (100% - Max force) - relevant for instrumented applications. |
DragDistanceX | Integer | Horizontal distance of drag, starting from the Element Coordinates. |
DragDistanceY | Integer | Vertical distance of drag, starting from the Element Coordinates. |
DragDuration | Integer | Duration of the pop (drag) action in milliseconds. |
Usage
Command can be used to force touch an element.
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
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);