Skip to main content

Mark tests as passed or failed

For every appium test, you can mark the test as passed or failed using our REST API for your internal reference. This is particularly useful when a test successfully ran on BrowserStack but there was a failed assertion in the test case. If a test has failed, you can also record a reason for its failure.

Here is an example API request to update the status and reason for an example session :

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PUT -H "Content-Type: application/json" \
-d "{\"status\":\"failed\", \"reason\":\"Element not found\"}" https://api-cloud.browserstack.com/app-automate/sessions/f97f02bf39d592f5fc349cee419294fdfb7593a2.json

Shown below is a sample response to the above API request :

{
  "automation_session": {
    "name": "Sample Test",
    "duration": 58,
    "os": "android",
    "os_version": "7.0",
    "device": "Samsung Galaxy S8",
    "status": "failed",
    "hashed_id": "f97f02bf39d592f5fc349cee419294fdfb7593a2",
    "reason": "Element not found",
    "build_name": "Untitled Build",
    "project_name": "Untitled Project"
  }
}

The status and reason passed are visible on the session details page of App Automate dashboard:

Status reason passed or failed visible on the session details page of App Automate dashboard

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Talk to an Expert