Setting Up Backtrace for your Real Device Tests
Detecting errors and crashes and resolving them early on is key to the success of your app.
After you’ve completed the steps on this page, errors and crashes associated with your real device tests (automated or live) will be available for you in Sauce Labs.
Supported Platforms
Supported Platforms | Supported Systems | Supported Features |
---|---|---|
Real devices | Android | Errors and Crashes |
iOS | Errors |
Crashes for iOS apps are not supported when running real device tests in Sauce Labs with Backtrace.
What You'll Need
- A Sauce Labs account (log in or sign up for a free trial license).
- A Backtrace account (log in or sign up for a free trial license).
- Your subdomain name (used to connect to your Backtrace instance). For example,
https://example-subdomain.sp.backtrace.io
. - A Backtrace project and an API token with object:get and query:post capabilities.
- In the Backtrace Console, go to Project settings > API tokens.
- Click New.
- Select the object:get and query:post capabilities.
- Click Create.
Create Custom Attributes
Custom attributes are required to link the correct errors and crashes that occurred on the selected device and for the duration of the test.
The following custom attributes are required:
- Android
- iOS
Name | Format | Type |
---|---|---|
application.package | None | String |
device.model | None | String |
error.type | None | String |
Name | Format | Type |
---|---|---|
application.identifier | None | String |
device.machine | None | String |
error.type | None | String |
To add the attributes:
- In the Backtrace Console, go to Project settings > Attributes.
- Click +.
- Enter the values for the required fields.
- Click Create.
- Repeat steps 2 to 4 for each required attribute.
For more information about attributes, see Indexing Attributes.
Integrate the Backtrace SDK
- Android
- iOS
Enable the Backtrace Integration in Sauce Labs
This enables the Backtrace integration for all users in your organization. Once enabled, only organization admins can update the settings or disable the integration.
The Backtrace integration is specific to the data center that is active for your Sauce Labs account during setup. If you have access to multiple data centers, you must switch into each data center and complete the steps below to integrate Backtrace.
- From your Sauce Labs account, go to the Test Results details page (live or automated) for a real device.
- From the bottom of the screen, select the Error & Crash Reporting tab.
- Click Link with Backtrace.
- Enter the Project Name, Dashboard URL, and API Token.
- Click Save.
If you are an organization admin, you can also enable the Backtrace integration from the Integrations page.
Only one subdomain, project, and API token is supported per organization.
Run your Real Device Test
Throw an error or a crash to test your mobile app.
For information on how to run your real device test (live or automated), see Mobile App Testing.
View Test Results in Sauce Labs
After running a real device test with the Backtrace SDK integrated into your Android or iOS app, you can view errors and crashes in Sauce Labs.
- Go to the Test Results details page (live or automated) for a real device.
- From the bottom of the screen, select the Error & Crash Reporting tab.
View Errors and Crashes in Backtrace
From the Error & Crash Reporting tab, click any link to view more details (View Errors, View Crashes, Backtrace Dashboard) in the Backtrace Console.
For more information about how to view and analyze error and crash data in Backtrace, see Web Console Getting Started.