Last updated: Jun 22, 2020 16:54
Legacy | Native automation
For users of Perfecto's Native Automation use the Touch function (in the Functions tab) to perform the 3D Touch.
- Open the Advanced Parameters
- Select the Force value in the Operation mode parameter.
- Provide either:
- Exact <X, Y> coordinates where to tap the screen.
- Coordinates as percentages - to allow for different screen resolutions.
Alternatively, use the Record mode and create the action interactively, as above.
Selenium/Appium automation scripts
To activate the Touch function in 3D Touch mode use the following (Java) sample code as a basis:
Perfecto's 3D Touch support is available for all iOS devices (iPhone6S or later) running iOS 10.3 or later, on XCUITest framework, and support the necessary hardware.
- On iOS 11 – using 3D Touch in SpringBoard is unstable and may cause the device to become unresponsive after an action (usually released by just pressing the Home button). This is a limitation stemming from Apple’s API.
When using 3D touch on iOS device the following menu items are not usable: "Mark My Location", "Send My Location" and "Search Nearby" button. These cannot be clicked manually or automatically. This limitation stems from Apple's implementation.
- 3D Touch commands cannot be sent using the Appium driver.performTouchAction(touchAction) method.
- When executing a script using the Appium value for the automationName capability on iOS 11 or on supported iOS 10 devices with the XCUITest value for the automationName capability, coordinates retrieved from objects will not be executed correctly using Perfecto’s Touch command.
The reason is that Appium bases the screen size on UI Points, whereas in Perfecto the screen size is based on Rendered Pixels.
For an explanation about the difference, see: https://www.paintcodeapp.com/news/iphone-6-screens-demystified.