How to continue execution when Assertion is failed

前端 未结 5 1521
小鲜肉
小鲜肉 2020-11-28 12:42

I am using Selenium RC using Java with eclipse and TestNG framework. I have the following code snippet:

assertTrue(selenium.isTextPresent(\"Please enter Emai         


        
5条回答
  •  孤城傲影
    2020-11-28 13:32

    I am adding again one of the easiest ways to continue on assertion failure. This was asked here.

    try{
            Assert.assertEquals(true, false);
            }catch(AssertionError e)
            {
                System.out.println("Assertion error. ");
            }
    
            System.out.println("Test Completed.");
    

提交回复
热议问题