Skip to main content

Mobile Studio - Test Editor

This tutorial helps you 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. Note that only Appium 7 and below are supported.

To develop a test, you need to Open a device in Automation Mode.

Refer the video for more details.

Test Editor Flow

There are these flows you can follow when you use the Test Editor.

Path Selection

  1. Select an element and copy its Xpath to the filter,
  2. Click Add Step button. A dropdown will open with available actions (see Supported Commands).
  3. 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.

Test Editor

  1. Click on a Test Editor button.  The Test Editor appears.
  2. Click Add Step.
  3. Click your preferred action and add a locator strategy 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.

info
  • Add Step is only be enabled if there is xpath in filter input. If the filter input is empty, Add Step is disabled.
info

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

info

Active Steps are steps whose checkbox is marked true/tick.

You can perform these actions in Test Editor.

  1. Position Window - Positions test editor window in these ways**.** Floating or Aligned to the Right. You can change the position of the window from the position button.
  2. Documentation - Provides information about the Test Editor.
  3. Test Name/Rename - Displays the test name, which can be renamed by clicking on it.
  4. Test Editor Menu - A menu containing various Test Editor actions.
  5. New Test - Resets the Test Editor to its default state. Prompts to save any unsaved tests before resetting.
  6. Open - Opens the Test Manager. Prompts to save any unsaved tests before opening the Test Manager.
  7. Save - Saves the current test. If it's a new test, it opens the "Save Test" popup to ask for a name and workspace to save it in.
  8. Save As - Creates a new test with a different name, populating the steps from the current test.
  9. Export Code - Opens the Export Code screen.
  10. Settings - Opens the Test Editor settings.
  11. Add Step - Adds a new step. When clicked a dropdown opens allowing you to select the desired action.
  12. Record - Starts recording the actions performed on the screen and adds them as steps to the Test Editor.
  13. Play/Pause  - Runs or pauses the test. The test runs one step at a time in the same order as displayed. Only active steps are executed. 
  14. Delete - Deletes the selected steps. Only Active steps are deleted.
  15. Drag and Drop - Allows steps to be reordered by dragging and dropping.
  16. Action Dropdown - Allows you to change the action type using this dropdown.
  17. Locate By Dropdown - Selects how to locate the element using XPath, ID or Accessibility ID.
  18. Locator Strategy Value Area - Displays the XPath, ID or Accessibility ID .
  19. AI powered Test Creation - Create your automation test with natural language.

Generated Code 

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
  • Python
  • Ruby
  • C#

info

Exported code for activate app for grid runs on the limited version of appium lib.