Forum Discussion

RJanecek's avatar
RJanecek
Regular Contributor
13 years ago

validate soapfault via groovy script

Hi,
is possible to validate response if it is soapfault via groovy script or is possible to validate it as assertation but turn it off sometime when some patameter will by off

4 Replies

  • RJanecek's avatar
    RJanecek
    Regular Contributor
    I found something similar :

    context.getTestSuite().getTestCaseByName("teststep1").getTestStepByName("Zadost").addAssertion("SOAP Fault")

    but this isnt exactly what I want
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    you could either add the assertion and enable/disable it via a script;

    context.getTestSuite().getTestCaseByName("teststep1").getTestStepByName("Zadost").getAssertionByName( "..." ).disabled = true/false

    but you would have to do this before the request is submitted..

    would that work?

    regards!

    /Ole
    SmartBear Software
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    yes this works but it isnt still what I want. this solution change code in sopaUI project what I dont want
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    then you would have to do it via a groovy script - just search for the soap fault element in the response..

    regards,

    /Ole
    SmartBear Software