Forum Discussion

kgbheem's avatar
kgbheem
Occasional Contributor
7 years ago

how to stop assertions execution when first assertion is failed

how to stop assertions execution when first assertion is failed 

my scenario is like : 

 

Login request:  i have added 3 assertions 

if i get bad ressponse and my first assertion will fail as it was expecting 200 and other assertions also gets failed.

 

here i want to tell that if first assertion is failed( status assertion) then stop verifying other assertions. how do i acheive this?

 

the idea i have is write assertions in groovy script and add condition  but this i can do in soap ui free version, is there a feature in ready api to acheive this?

 

Regards

Bheem

  • Lucian's avatar
    Lucian
    Community Hero

    Hey,

     

    You can do it with groovy as you said but the question is why would you want some assertions not to be checked?

    • kgbheem's avatar
      kgbheem
      Occasional Contributor

      well.. 

       if you are not able to login then what would be the point of verifying other assertions and mark it as failed?

       

      if i get 200 status then only i want to verify other things otherwise it should stop right there

       

       

      • Lucian's avatar
        Lucian
        Community Hero
        This is not how this is supposed to be used. Normally you would have a couple of assertions based on which you would decide if a test step is passed or failed.

        What you are looking for are conditional assertions which I didn't see before and for which I don't really see a good use.

        Indeed you can be sure that a test fails just after checking one assertion but how does it hurt if all are checked especially when they are all evaluated in a blink of an eye?
  • Olga_T's avatar
    Olga_T
    SmartBear Alumni (Retired)

    All, thank you for your replies.

    kgbheem, did you find the appropriate answer to your questions? Or, maybe, do you have an update for us?

    If the issue is solved, please click the Accept as Solution button below the appropriate reply so that other users could quickly find the answer if they face a similar question.

     

    Thank you in advance,

     

    • kgbheem's avatar
      kgbheem
      Occasional Contributor

      no, if i abort the test execution then report is not getting generated....