Forum Discussion

cbroad's avatar
cbroad
Occasional Contributor
4 years ago
Solved

Skip test if previous test scenario failed.

Hi All. 


I have created a test suite, and am wondering if it is possible to skip a test if the previous test failed.

Above is the suite, and the test(s) in question are the Add/Remove VMF. 
If the Add test fails, there is no point in running the Remove test, as the data will not be present on the account under test. 

  • Hi,

     

    Make Remove WMF test item a child of the Add WMF one and set the On Error property of the latter to Stop Current Item.

     

    However, my personal preference is tests architecture when test can identify the similar entity from the previous test run and act on it if the most recent entity is not available for some reason.

    I prefer this because with the traditional approach essential information becomes to be not available during the test run. Using your case as a sample: VMF's addition fails for some reason and you will not be able to say anything about whether or not the VMF item still can be deleted. So you get more limited information about the state of the tested program.

     

3 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Make Remove WMF test item a child of the Add WMF one and set the On Error property of the latter to Stop Current Item.

     

    However, my personal preference is tests architecture when test can identify the similar entity from the previous test run and act on it if the most recent entity is not available for some reason.

    I prefer this because with the traditional approach essential information becomes to be not available during the test run. Using your case as a sample: VMF's addition fails for some reason and you will not be able to say anything about whether or not the VMF item still can be deleted. So you get more limited information about the state of the tested program.

     

    • cbroad's avatar
      cbroad
      Occasional Contributor

      Thanks AlexKaras 

      I will use the setting it as a child method, and then investigate other options such as suggested. 

      Cheers.

       

      Chris, 

    • sonya_m's avatar
      sonya_m
      SmartBear Alumni (Retired)

      Thank you for sharing your expertise with us, Alex๐Ÿ™‚

       

      Hi cbroad ! Does this answer your question?