How to mark test to mark Passed/Failed test status on LambdaTest?

How to mark test to mark Passed/Failed test status on LambdaTest?

Hi Emma,

To mark Passed or Failed test on LambdaTest cloud you need to use

bool passed = TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Passed;

to get the value of the test result which needs to be passed in the JavaScript executor to mark that status on LambdaTest and make sure to use the full snippet in the teardown method

[TearDown]
public void Cleanup()

{

bool passed = TestContext.CurrentContext.Result.Outcome.Status == NUnit.Framework.Interfaces.TestStatus.Passed;
try
{
// Logs the result to LambdaTest
((IJavaScriptExecutor)driver.Value).ExecuteScript("lambda-status=" + (passed ? "passed" : "failed"));


}
finally
{

// Terminates the remote webdriver session
driver.Value.Quit();
}