Forum Discussion

pdenize's avatar
pdenize
New Contributor
15 years ago

How can I test for a Connection refused error

I need to test the security of a product. While the webservices all exist I need to verify they are blocked by the infrastructure based on IP address rules. Also we need to ensure that HTTP is not an option.

If I setup and perform these tests each tests gets a "Connection refused error" and the soap call fails (stopping the test). However for me this is what I want to occur so would like this to be a PASS not a fail. It is the expected result.

The failure also stopps any Assertions running and all the following test steps. I still need the Groovy scripts after the call to run so I can validate the correct Auditing has taken place.

The "Connection refused" resulting in an uncontrolled failure makes this less useful. Is there a way to control this so the soap call does not fail, and the assertions and scripts after can be executed (or maybe just the scripts).

Thanks

1 Reply

  • Jasper175's avatar
    Jasper175
    Frequent Contributor
    Hi - I'm not doing any testing like your doing, but what comes to my mind and forgive If I'm speaking to elementary.

    1. In your failures are you getting a SoapFault? How does the error look?
    > I have to maintain two testSuites - one Positive Test (using "Not SoapFault" assertion) & Negative Test (using "SoapFault" assertion)
    > Also I use contains depending on the response. ** this ensures the API will be green regardless.

    2. For failures and I want to keep the project running - In the testCase Editor > Tools - I uncheck the "Abort on Error:" [] Fail on Error, so that the project keeps running. ** but I know you want to see green thus #1 is how we have the assertions set.

    Rob