How to Perform Multi-touch Actions in Mobile App

Multi-touch action appears often in gaming applications. We will use MultiTouch Tester app to demonstrate automation testing on this common behavior. Please download the app from here or the direct apk file here.

Scenario:

Perform multi-touch at 4 different points at the same time on MultiTouch Tester display.

Handling Multi-touch Action in automation testing

Manual Mode:

  • Step 1: Select Start Application from mobile keyword and click on Input. A new dialogue will appear. In appFile select Value Type as Variable and in Value passing the variable name as path.

Handling Multi-touch Action in automation testing

  • Step 2: Add Wait For Element Present item.
  • Step 3: Initializing Katalon Mobile Driver to Appium Driver
  • Step 4: Call ‘Get Device Height‘ method and capture the height and store it in a variable ‘device_Height‘.
  • Step 5: Call ‘Get Device Width‘ method and capture the width and store it in a variable ‘device_Width‘.
  • Step 6: Add binary statement and get X, Y Coordinates for touch action 1 (top left side).
  • Step 7: Repeat step 6 for touch action 2 (top right side), touch action 3 (bottom left side), and touch action 4 (bottom right side).
  • Step 8: Create an object of MultiTouchAction class.
  • Step 9: Set all four touch actions on given X, Y Coordinates of the screen.
  • Step 10: Add a method call statement and press first action with X, Y coordinates and wait for 5 seconds then release. Repeat for the three other actions.
  • Step 11: The final step is to add a method call statement and generate multi-touch action chain.

Handling Multi-touch Action in automation testing

As you can see from the step-by-step guide above, there are repeated steps that will be easier to create in Script Mode. Thus, we suggest the users utilize this feature where one can quickly automate the test scenario and easily manage test scripts.

Script Mode:

The source code is available here. For further instructions and help, please refer to Katalon User Guide or Katalon Forum.

 

83% people found this helpful
Related testing tools
Katalon Studio
Best automation solution for software testing team. Completely free!
Katalon Recorder
Ultimate Selenium IDE to record, play, and debug app. Fast and extensible!
Katalon Analytics
Bring you to the next level of test execution reports. Smart and seamless solution!
Scroll up