SeeTestAutomation- Pinch
Please note that this tool is classified as a Legacy tool. We recommend transitioning to our updated solutions to maintain optimal performance and security in your workflows. For more information on this matter, please reach out to technical support .
Pinch(int inside, int X, int Y, int Radius, boolean Horizontal)
This is supported in iOS and Android 4.3 and higher.
Description
Pinch In/Out at specific location using a specific pinch radius.
Parameters
-
Inside: Boolean set the direction of the pinch - In/Out:
- True for Pinch in (Zooms out)
- False for Pinch out (Zooms in)
-
X: The x coordinate of the center point from top left. (can use p2cx to convert screen percentage to pixels).
-
Y: The y coordinate of the center point from top left. (can use p2cy to convert screen percentage to pixels).
info- When the coordinates(X,Y) value is (0,0), the center point of the pinch will be in the middle of the screen
-
Radius: The pinch radius in screen pixels.
-
Horizontal: Boolean set the direction of the pinch - Vertical/Horizontal:
- True for Horizontal
- False for Vertical
Performing pinch directly on the User Interface (UI):
-
Pinch in (Zooms out): Scroll the mouse wheel down while pressing the control (CTRL) key.
-
Pinch out (Zooms in): Scroll the mouse wheel up while pressing the control (CTRL) key.
- If the center point or the end point(starting point+radius) will exceed the borders of the screen, the pinch action will fail
Usage
The following examples demonstrate how the pinch command works, using google maps:
Example 1: Zoom out, vertically:
Parameters:
- Inside: set to- true
- X: set to - 500
- Y: set to - 700
- Radius: set to – 200
- Horizontal: set to - false
:
Example 2: Zoom in, vertically:
Parameters:
- Inside: set to- false
- X: set to - 500
- Y: set to - 700
- Radius: set to – 200
- Horizontal: set to - false
Example 3: Zoom in, horizontally:
Parameters:
- Inside: set to- false
- X: set to - 500
- Y: set to - 700
- Radius: set to – 70
- Horizontal: set to - false
Code Examples
Java Example
if(client.pinch(true, 600, 1000, 700, false)){
// If statement
}
C# Example Expand source
if(client.Pinch(true, 600, 1000, 700, false))
{
// If statement
}
VBScript Example Expand source
If StrComp (client.Pinch ( true, 600, 1000, 700, false), "True") = 0 Then
Report
'If statement
Else
Report
End If
Python Example Expand source
if(self.client.pinch(True, 600, 1000, 700, false)):
# If statement
pass
Perl Example Expand source
if($client->pinch(1, 600, 1000, 700, 0)){
# If statement
}