An Introduction to Katalon Mobile Recorder
An Introduction to Katalon Mobile Recorder
Learn how to use this automated testing tool to record your mobile app tests.
Join the DZone community and get the full member experience.Join For Free
Sensu is an open source monitoring event pipeline. Try it today.
Test recording is the fastest way for users to automate applications. However, identifying objects in applications is time-consuming and tedious. The Katalon Studio Record Mobile feature allows users to record and run the same tests on multiple devices with ease.
This tutorial shows you a step-by-step introduction to utilizing Katalon Mobile Recorder.
Recording Your First Test With Katalon Studio Mobile Recorder
Sending a message:
Launch the App under test (ApiDemos.apk).
Tap on “OS” text.
Tap on “SMS Messaging” text.
Enter Recipient, Message Body, and click on Send.
Follow the steps below to familiarize yourself with Mobile Recorder feature from Katalon Studio.
Step 1: Launch Katalon Studio, go to File > New Sample Project > Sample Mobile Testing Project in order to utilize the sample project provided by the Katalon Team. You will notice that there are two sample test cases added for your reference. However, this tutorial will guide you through creating your own test case. Click on the New Test Case button on the main toolbar. Provide a name for your test case and click OK. An empty test case will be created.
Step 2: Click on Record Mobile from the main toolbar.
Step 3: Select a device under Device Type (if you wish to utilize the Kobiton integration or other emulators, select it here). Browse your Application File and proceed.
- Step 4: Click on the Start button to begin recording your test case. Wait until your app is launched.
Step 5: Click on the “OS” button on your application. Katalon Mobile Recorder will find the object among the All Objects list and highlight your selection in green.
Step 6: Once the object is selected, the actions in Record dialog box will be enabled. Click on the “Tap” action.
Step 7: Once Tap action was performed, the emulator will be rendered with elements which are visible, you will see a progress information dialog. You will see the Tap in the list of Recorded Actions.
Step 8: To continue, click on “SMS Messaging” button on the new app interface. Similarly, click on “Tap” action to add it in Recorded Actions.
Step 9: Select the “Recipient” object in the actions in Record Dialog box or Mobile Screen. Click on “Set Text” action in a new popup where the user needs to enter the input (“katalon”) and click on OK.
Step 10: Select the “Message Body” object in the actions in Record Dialog box or Mobile Screen. Click on “Set Text” action to input “Mobile Automation” as text. Set Text action will be added in Recorded Actions.
Step 11: After finishing with your desired list of actions, you can stop the recording by clicking on the Stop button at the top or OK button at the bottom.
Step 12: A dialog box will be displayed for storing recorded objects into the object repository.
Step 13: If you want to add a new folder, click on New Folder. A popup dialog will be displayed, enter the name of the folder and proceed.
Step 14: Select your newly created test case among the Test Explorers drop-down. Recorded objects and actions are saved in the test case as shown below.
Step 15: You can run this test case by clicking on the Run button. Because the default browser is Firefox, click on the drop-down to see other selections and choose your desired device. Katalon Studio will execute the recorded steps accordingly.
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile 'Start the Application' Mobile.startApplication('.\\Data Files\\ApiDemos.apk', true) 'Tap on text \"OS\"' Mobile.tap(findTestObject('Record Mobile Test Case/android.widget.TextView8 - OS'), 60) 'Tap on text \"SMS Messaging\"' Mobile.tap(findTestObject('Record Mobile Test Case/android.widget.TextView4 - SMS Messaging'), 60) 'Enter text as \"Katalo\" in Recipient text box' Mobile.setText(findTestObject('Record Mobile Test Case/android.widget.EditText0'), 'katalon', 60) 'Enter text as \"Mobile Automation\" in Message Body text box' Mobile.setText(findTestObject('Record Mobile Test Case/android.widget.EditText1'), 'Mobile Automation', 60) 'Tap on Send Button' Mobile.tap(findTestObject('Record Mobile Test Case/android.widget.Button0 - Send'), 60) 'Close the Application' Mobile.closeApplication()
Published at DZone with permission of Oliver Howard . See the original article here.
Opinions expressed by DZone contributors are their own.