About
In TestComplete, you create automated tests for mobile applications running on devices controlled by the BitBar mobile device cloud or by a private Appium server. The easiest way to create a test is to record it.
Before recording tests
Make sure that all requirements and prerequisites are met:
1. Plan your test
-
Decide on the purpose of your test.
-
Consider what steps your test should contain and over which application parts these steps are to be performed.
-
Think of what the outcome of the steps will be and how your test will verify the outcome.
2. Connect to the mobile device and start a testing session
For your tests to be able to access your mobile application, connect to the server that controls the device, install the application to the target device, and open a testing session for it:
In the BitBar device cloud
-
Click Show Mobile Screen on the TestComplete toolbar.
Note: If the button is hidden, you can make it visible as it is described in Customizing Toolbars and Menus.
-
TestComplete will open the Mobile Device Screen and then show the Select BitBar Device dialog.
-
If the current TestComplete project does not have a BitBar API key specified, to connect to the BitBar device cloud dialog, enter the API key.
-
On the Parameters tab, select the mobile device and a tested application for which you want to open a testing session.
The Found devices list contains all the devices that are available for you in BitBar and that match the search criteria. If needed, you can filter the list by using the Device Type, OS Version, Resolution and Quick Search filters. Select the device to which you want to connect.
-
In the Application drop-down list box, select a mobile application for which you want to open a testing session. The application file must be either stored in the BitBar Files Library or added to the Tested Applications of the current TestComplete project. In the latter case, click Upload to BitBar to upload the application file to the BitBar Files Library and then select it in the list.
-
If needed, on the Custom parameters tab, you can specify additional capabilities to be used for the testing session. Specify the capabilities in the JSON format. For example:
JSON
{
"bitbar_project": "Automated tests",
"bitbar_description": "Testing the Orders app"
}The will validate the JSON code as you are typing it.
For the list of available capabilities, see the BitBar Documentation - Desired Capabilities.
-
Click OK.
On mobile devices controlled by a private server
-
Click Show Mobile Screen on the TestComplete toolbar.
Note: If the button is hidden, you can make it visible as it is described in Customizing Toolbars and Menus.
-
TestComplete will open the Mobile Device Screen and then show the Select Local Device dialog.
-
In the dialog, click Local Appium.
-
In the Parameters editor, enter the capabilities that describe a testing session you want to open, in the JSON format. The dialog will validate the JSON code as you are typing.
For information on all available capabilities, see Appium Desired Capabilities.
-
Click OK.
After TestComplete connects to a testing session, you can access your tested mobile application from TestComplete:
-
You can view and explore your application in the Mobile Screen window and capture individual objects with the Object Spy:
-
You can explore your application and its object hierarchy in the Object Browser:
Note: The Object Browser shows the image of selected objects, which makes the search easier.
3. Record user actions
-
Start recording in any way you find suitable. See Recording Automated Tests.
-
TestComplete will show the Recording toolbar.
-
In the Mobile Screen window of TestComplete, interact with your tested application as an end-user would: click the controls, input data into forms, and so on.
-
Stop the recording.
TestComplete will process the recorded actions and generate the test. The images below show an example of a recorded mobile test:
A keyword test |
A script test |
A test consists of the sequence of operations that define various interactions with objects in the tested mobile application.
You can modify and enhance the recorded test in a number of ways to make it more flexible and efficient. For example:
-
Add new operations, reorder operations and modify their parameters.
-
Delete or disable unneeded operations (for example, superfluous recorded operations).
-
Insert checkpoints for verifying objects and values in the tested application.
-
Create data-driven tests that run multiple test iterations using different sets of data.
4. Close the session and disconnect from the server
If needed, you can close your current testing session and disconnect from the mobile device. To do this, use the Mobile.Device(<Device_Name>).Disconnect
method. To call the method from a keyword test, you can use the Call Object Method, Run Code Snippet, or Run Script Routine operation.