Use gesture operations
Gesture operations are finger movements that you perform on the touchscreen of your mobile device. With the Mobile Engine 3.0, you can use mobile-specific gesture operations to perform the following actions:
In some mobile applications, a swipe might unintentionally trigger a tap on a control. To avoid this situation, you can use the Draw on Screen Module and set the ModuleAttribute Long Tap to True. |
Prerequisites
When you perform a gesture operation, ensure that you:
-
Have only one browser tab open.
-
Hide the Favorites bar from view in Safari on iOS.
Perform a gesture operation on a mobile control
The table below lists all gesture operations that you can perform on mobile controls.
Gesture operation |
Description |
Tap on the current control. |
|
{LONGCLICK} |
Long tap which lasts 2 seconds. |
{SWIPERIGHT} |
Swipe right on the current control. |
{SWIPELEFT} |
Swipe left on the current control. |
{SWIPEUP} |
Swipe up on the current control. |
{SWIPEDOWN} |
Swipe down on the current control. |
To perform a gesture operation on a control, follow the steps below:
-
Specify the necessary test configuration parameters to establish a connection with the device.
-
Add either the Open Mobile App TestStep or the OpenUrl TestStep as a first TestStep.
-
Create a Module out of the control on which you want to perform a gesture operation.
-
Drag and drop the Module onto your TestCase.
-
Optionally, set the steering parameter ScrollingBehavior to None. This ensures that the controls you want to swipe remain in the same position on the screen.
-
In the Value column, specify the gesture operation that you want to perform.
In the example below, you perform a long tap on a TextBox control.
{LONGCLICK} gesture operation on a control |
Perform a swipe operation directly on the screen
You can perform a swipe directly on the touchscreen of your mobile device with the Module Swipe on Screen. This Module is part of the Standard subset. You can find it under Standard modules->TBox XEngines->Mobile.
The length of the swipe movement is equal to one third of the mobile screen size.
To perform a gesture operation directly on the screen, follow the steps below:
-
Specify the necessary test configuration parameters to establish a connection with the device.
-
Add either the Open Mobile App TestStep or the OpenUrl TestStep as a first TestStep.
-
Drag and drop the Swipe on Screen Module onto your TestCase.
-
From the drop-down in the Direction ModuleAttribute, select the direction of the swipe.
-
Optionally, specify the behavior of the swipe:
If you provide the End Point coordinates, set the Direction ModuleAttribute to SWIPE. |
In this example, you perform an upward swipe that lasts 1 second.
Swipe On Screen Module in a TestCase |