Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

please find the code

Test(dataProvider = "User_login")
public void StatusForm_Verification(String uname, String pwd)
    throws InterruptedException {
    try {
NavigateToLogin();
Dashboard RD = LoginAs_user(uname, pwd);
Thread.sleep(2000);

    if (Integer.parseInt(ReviewedStatuscount) >= 1) {

        Assert.assertEquals("true",
                revui.Btn_SaveReview.getAttribute("disabled"));

        Assert.assertEquals("true",
                revui.Btn_submitReview.getAttribute("disabled"));

        Assert.assertEquals("true",
                revui.Btn_Needmoreinfo.getAttribute("disabled"));

        status = TestLinkAPIResults.PASSED;     

    } else {
        throw new SkipException(
                "Test Skipping - Reviewed count is Zero");
    }
    }catch((AssertionError ex) {
        testlink_result = TestLinkAPIResults.TEST_FAILED;
        msg = ex.getMessage();
}
}

while executed a above method if any Assertion Error thrown then in the TestNG report it should be an FAIL status - this is for correct

but if i use an Try catch block (catching the AssertionError) in the above method the TestNG report was always PASS status, why? How?

share|improve this question
add comment (requires an account with 50 reputation)

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.