Report code samples (JavaScript SDK)
Access current report status during runtime
This example shows how to access the current report status during runtime, and write different scenarios of the test execution according to the obtained value.
In UFT Developer JavaScript SDK Reference 2021 R1 and later
LFT.Reporter.getStatus().then(function(statusAsString) {
if (statusAsString == LFT.Reporter.Status.Passed) {
//continue test execution
} else {
//make custom action
}
//code to be executed regardless of status value
});
In UFT Developer JavaScript SDK Reference 2021 and earlier
var reportStatus = LFT.Reporter.getStatus();
if (reportStatus == LFT.Reporter.Status.Passed) {
//continue test execution
} else {
//perform a custom action
}
See also: