Adding or editing an element

To add an element to the repository several tools are available.

  • Suggested elements - elements are automatically suggested to you by Suitest based on your app's view structure.

  • Mouse selection - select and add elements by using the on-screen mouse pointer.

  • View structure - select and add elements directly from the view structure.

  • Search by property - select and add elements by their specific properties.

  • Manually by pressing the

    new element

To activate any of the repository tools you must be connected to a device and an application must be opened on the device.

Identifying properties

Identifying properties are element properties that are used to look up the element during test execution. To add an element you must specify at least one identifying property.

Identifying properties

The following identifying properties are available:

Think of the identifying properties as filters for elements. Every specified property will further reduce the set of matching elements. For example specifying both Text and Color will look for elements that have the text content and the corresponding color.

Multi-platform support

If your application supports several platforms, the element identifying properties may differ per platform. Suitest allows you to specify a separate set of identifying properties per platform. During the test execution Suitest will automatically determine the platform for which to load the identifying properties based on what platform is supported by the device.

Editing saved elements

Saved elements properties can be edited via the "Edit" button once a saved element is selected.

In edit mode the properties picker is active, clicking on saved elements, mouse selection or view structure will grab the element properties and show the changes.

Edit element properties via properties picker

Edit element via suggested elements

Update properties

In edit mode the "Update all" button is available. This updates the properties of the element if the element is currently present on the devices screen. This can be used to update the elements state when the apps state changes.

Discard changes

Discard changes, removes all changes made while editing an element.

Save as new

Allows you to take a baseline element, edit it and then save it as a new element. You will need to change the Name and API Id of element to make sure it is unique.

Default properties

Setting default properties in the element repository, sets the properties when you use the element within the Test editor.

Default properties of an element

Example usage

Selected default properties for the element that will be used as default when an assertion is created within the test editor.

Selected default properties

When the assertion is created the default properties for the element are selected.

Test editor default properties when element assertion created

Element property snapshot

When you add an element to the repository Suitest looks it up in the application's view tree and collects some data about the current state of that element. We call this data "a baseline snapshot of the element properties". When you later make assertions in your tests Suitest autocomplete them with the data from the baseline snapshot.

You can save one baseline snapshot per platform. To make sure that the data in the snapshot is trustworthy it is best to create the snapshot when connected to a device on which the application is known to work.

Renaming / Removing elements

Saved elements anatomy

  1. Test appearance - tests that the element is used in
  2. Element details - quick element details overview
  3. Dropdown - to open up rename and remove options
  4. Rename - rename the element
  5. Remove - remove the element from repository (not removed till changes are applied)

Importing / Exporting elements

Sometimes you might need to copy an element from one application to another. For example, if you are using a white label app.

You can import or export elements to and from the Element repository. This can be done while viewing or editing elements. The element is exported with all its properties in JSON format.

Import and export buttons

List of tests where an element is used

Inside Suitest Element repository, you are able to identify unused elements as well as see in which test the element is used.

Unused element

List of tests where element is used