Forum Discussion

Raghav19's avatar
Raghav19
Occasional Contributor
6 years ago

Script Assertion not running when request failed[Connection refused] in request log and no response

Script assertion in my API request is not running when request log shows Connection refused and there is no reponse.

This happens when i run the test case as a set with multiple steps and if i run the API step manually, the assertion seems to work?

How come?

I want the script assertion to run even if the request fails as i am reading the Error log of ReadyAPI via groovy script and doing an assertion

Is there a way?

4 Replies

  • Hi Raghav19,

     

    Can you please provide any kind of screenshot of error or your groovy script.

    As you have mentioned, it seems that there is some problem with groovy code.

     

     

    • Raghav19's avatar
      Raghav19
      Occasional Contributor

      I have a script which triggers a specific API call step

       

       

      After the step calls the Create Auth Token request , I get Connection refused in my Request log but then the groovy caller code is getting marked as fail as show.

      Another solution that i was trying was to read the Request Log of the API call from groovy script for which I couldnt find any

       

      • HimanshuTayal's avatar
        HimanshuTayal
        Community Hero

        Hi Raghav19,

         

        As i see in error, it states connection refused, generally this error generates when there is some firewall settings.

        Try to run this request individually, if it works individually then attached the full screenshot of groovy script.