[Test] public void DemoReportFail() { var test = extent.CreateTest("DemoReportFail"); Assert.IsTrue(false); test.Fail("Assert Fail as condition is false"); }
I presume that test.Fail is what actually logs the outcome as a fail, but what if I had a test like this:
[Test] public void DemoReportFail() { var test = extent.CreateTest("DemoReportFail"); Driver.Instance.FindElement(By.Id("foo")); test.Pass("Assert Pass"); }
If the test fails because the ID "foo" cannot be found, can I log this as a failure? At present my test case is passing when I want it to fail with a message informing me that ID "foo" cannot be found.
Forgive me if this is basic, I am very new to this!
As per the title. If my code is:
[Test] public void DemoReportFail() { var test = extent.CreateTest("DemoReportFail"); Assert.IsTrue(false); test.Fail("Assert Fail as condition is false"); }
I presume that test.Fail is what actually logs the outcome as a fail, but what if I had a test like this:
[Test] public void DemoReportFail() { var test = extent.CreateTest("DemoReportFail"); Driver.Instance.FindElement(By.Id("foo")); test.Pass("Assert Pass"); }
If the test fails because the ID "foo" cannot be found, can I log this as a failure? At present my test case is passing when I want it to fail with a message informing me that ID "foo" cannot be found.
Forgive me if this is basic, I am very new to this!