'browser stack test result dashboard Rest API results column shows Unmarked
I have configured Protractor with browser stack for my project purpose. i am able to successfully run the test cases in browser stack local. The Problem is on test results in browser stack under test result dash board there is a column called Rest API which is always shows Unmarked even after the test is getting passed. Can Some One help me on this regard? Is it necessary that Rest API Column must be updated with API status?
Solution 1:[1]
Without using the browserstack API we cannot update the results. You can use the below curl command after the test execution to update the results in browserstack. You should pass:
- username
- accesskey
- status(passed/failed)
- reason-text
- session-id
curl -u "username:accesskey" -X PUT -H "Content-Type: application/json"
-d "{\"status\":\"status(passed/failed)\", \"reason\":\"reason-text\"}"
https://api.browserstack.com/automate/sessions/session-id.json
Solution 2:[2]
It is not necessary for the Rest API column to be updated with the API status. You can set different things for this to give you an easier look at say a test that passed via selenium via BrowserStack but did not pass based on certain assertions defined in the test itself...for this..you can add this to your code..
title = @driver.title
assert_equal("Incorrect Page Title", title)
end
def teardown
api_url = "https://#{ENV["BROWSERSTACK_USER"]}:#{ENV["BROWSERSTACK_ACCESSKEY"]}@www.browserstack.com/automate/sessions/#{@driver.session_id}.json"
RestClient.put api_url, {"status"=>"failed", "reason"=>"Wrong title"}, {:content_type => :json}
@driver.quit
end
end
Which if the test passes on Browserstack but fails based on certain aspects, the unmarked would be replaced with Failed in Red to help you be able to debug faster.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tivie |
| Solution 2 | Tivie |
