Interactions
Interactions is a functionality that allows you to record every test session’s action and check how it interacted with the app’s UI. By reviewing the taps you can check if certain interface elements failed to load or crashed.
What You'll Need
- A Sauce Labs account (Log in or sign up for a free trial license)
- A native Android, iOS, or iPadOS mobile app
Using Interactions for Real Devices
By default, the Interactions feature is enabled if the instrumentation feature is enabled. To enable device instrumentation:
- On Sauce Labs, click Live > Mobile App.
- Upload your mobile app to Sauce Labs through the UI or CLI.
- After you’ve uploaded your app, return to the Live > Mobile App page, hover your mouse over your app, then select Settings.
- Under Default Settings, toggle Instrumentation on.
Now you can start your live or automated testing session. Interactions will be captured and be part of your test results.
The Interactions feature works for all the automated test framework types.
Interaction Metrics
You can use Interactions to understand what happened in your test session and improve your app's performance, stability, and more. At the top of the Test Results page, you can see the data on activities that occurred during the testing session. To get more detailed information, click on the dropdown icon next to an action you want to investigate.
The following table lists the available metrics:
Name | Description |
---|---|
label | The user-readable label for a particular activity. |
viewTag | A tag that provides additional information associated with a view. |
viewId | Identifier that defines view attributes. |
className | The class name of an element. |
contentDescription | The description of an element. |
xPosition | The horizontal position of the tap. |
yPosition | The vertical position of the tap. |
xPath | Used to locate an element in the XML structure of the app. |
You can use the xPath value to build your Appium test quickly!
Accessing Interactions Metrics
You can access Interactions metrics from the Live Test Results or Automated Test Results page:
You can also download the results using the API call below:
curl --compressed \
-O https://{SAUCE_USERNAME}:{SAUCE_ACCESS_KEY}@{DATA_CENTER}.saucelabs.com/v1/rdc/jobs/{JOB_ID}/insights.json
Limitations
Webviews and hybrid apps are not supported