Error Reports
Appelium provides non-fatal error reporting via simple APIs. When enabled, you can report errors that don't cause crashes but are still worth tracking and investigating.
What error reports contain
Each error report includes:
- Error message provided by the caller.
- Error timestamp at the moment the error is reported.
- Application logs captured up to the moment of the error.
- User identifier if one has been set.
- File attachment if provided via the listener.
Enabling error reporting
As all Appelium SDK features, error reporting is off by default and needs to be explicitly enabled during Appelium initialization:
AppeliumFeedback.start(
apiKey = <#api key#>,
application = this,
errorReporting = ErrorReportingConfiguration.Enabled()
)
Reporting errors
Once enabled, you can report errors to the Appelium Dashboard using a message:
AppeliumFeedback.reportError(message = "Unable to parse response JSON")
or by passing an Exception directly:
AppeliumFeedback.reportError(exception = NullPointerException("Unable to access parent node"))
Error reports are collected within the current session and uploaded together with other session diagnostics when the app transitions to the background.
Automatic ANR detection
When error reporting is enabled, Appelium automatically monitors the main thread for unresponsiveness. If the main thread is blocked for more than 5 seconds, an error report is generated automatically with the message describing the ANR event and a captured stack trace of the blocked thread.
Note
ANR detection is automatically disabled when a debugger is connected, to avoid false positives during debugging sessions.
Error grouping
Reported errors are automatically grouped on the server based on message similarity. Errors with similar messages are grouped together, making it easier to identify recurring issues and track their frequency across versions and devices.
Attaching data to error reports
Optionally you can set an ErrorsListener to attach additional data to error reports. The listener must be set after calling start():
1 2 3 4 5 | |
Note
Each file attachment is limited to 100KB. If longer data is passed, only the last 100KB will be used.
Attaching user identifiers
In order to attach a user identifier to each error report you can use the following APIs:
AppeliumFeedback.setUserIdentifier(userIdentifier = "ABC-12345")
Note that the identifier is limited to max 50 characters.