RE: How to make test cases run even if an exception occurs. Exceution of cases should not stop.


My selenium scripts are getting stopped if an exception occurred and the remaining set of cases are not executing in that suite file .

I want the suite to execute the remaining cases also even if an exception occured.

Thanks in advance.

mallik9292 Train Asked on November 10, 2014 in Selenium WebDriver.
3 Answers

Hi Malik

Are your test cases getting skipped or all the test cases getting failed with same exception

Below answer is if your remaining test cases are getting skipped
In testng skip happens mostly due to 2 reason

  1. dependent methods parent method fails
  2. Exception is thrown in Configuration Method(@BeforeMethod,@BeforeTest,@BeforeClass, @After …..)

I believe exception is thrown in some of the configuration method , as suggested by other do use try/catch atleast in configuration method,

Supporter Answered on November 10, 2014.
Add Comment

Your Answer

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