This tutorial allows you to build and execute test cases within mobile studio. You can create a test with different actions (for available actions, see Supported Commands). A test step is made up of an action and an optional Xpath. In some actions, additional text/dropdown selection can also be required. After all the steps are added you can run the test by a click of the button. Please note that we currently support Appium 7 and below.
To develop a test you'll need to Open a device in Automation Mode.
Test Editor Flow
There are these flows you can follow when you use the Test Editor.
- Select an element and copy its Xpath to the filter
- Click Add Step button. A dropdown will open with available actions (see Supported Commands).
- Select an action. A new step is added to the window. The step action is same as your selection and if applicable, the XPath text area appears having same value as filter text field.
- Click on a Test Editor button. The Test Editor appears.
- Click Add Step.
- Click your preferred action and add an Xpath to the step if required.
Run the Test
To run the test, click Run. While the test is running, the element upon which the current step is taking action is highlighted with a red rectangle around it.
Add Step is only be enabled if there is xpath in filter input. If the filter input is empty, Add Step is disabled.
Copying an XPath is not needed for some actions. However other steps like inserting minute and/or second or selecting an app or selecting swipe direction from dropdown might be needed.
Test Editor Actions
Active Steps are steps whose checkbox is marked true/tick.
You can perform these actions in Test Editor.
- Position Window -Positions test editor window in these ways. Floating and Aligned to the Right, Left, or bottom. You can change the position of the window from the position button.
- Add Step - Adds a new step. When clicked a dropdown will opens from where you can select the action.
- Play/Pause - Runs or pauses the test. The test will run one step at a time. Steps are executed in the same order as displayed on the screen. Only active steps are executed.
- Delete - Deletes the steps. Only Active steps are deleted.
- Drag and Drop - Drags and drop to change the order of steps.
- Action Dropdown - Changes the action type from this dropdown.
- Locate By Dropdown - Disabled
- Xpath Text Area - Xpath
- Application Dropdown - Selects an application which is to be launched (applicable in Activate App only).
- Direction Dropdown Selects a direction in to swipe in (applicable in Swipe Command only).
- Export Code - Opens the Export Code screen.
When you click Export Code you see a screen with the generated code. You can select the language from the drop down above. To copy the code, click Copy.
These languages are supported:
- Java Junit 5
- Java TestNG