Can the free edition of Soapui argue between the findings?

Is it possible to free the free version of Soapui between the outputs of two queries? I want to check if the value from the result is equal to the value from another output.

+3
source share
2 answers

Yes, you can! :-)
Here's the Groovy script that works in my soapUI v2.5.2 (this is pro, but it works in the free version too):

def r1 = context.testCase.testSteps["Request #1"].properties["Response"]
def response1 = r1["value"]
def r2 = context.testCase.testSteps["Request #2"].properties["Response"]
def response2 = r2["value"]

log.info "Request #1 response: $response1"
log.info "Request #2 response: $response2"

assert response1 == response2

Hope this works for you too.

Hurrah!
Shonzilla

+4
source

Another that worked:

def myContext1 = new com.eviware.soapui.support.GroovyUtils( context )
holderOpConfirmation = myContext1.getXmlHolder ("opConfirmation3 - Request 2#Response")

holderOpConfirmation.namespaces["bilhete"] = "http://bilhete.ic.cp.fujitsu"
def ticketNo1 = holderOpConfirmation[ "//bilhete:ticketNo//bilhete:number" ]

log.info "ticketNo1: $ticketNo1"

//Segundo Bilhete
def myContext2 = new com.eviware.soapui.support.GroovyUtils( context )
holderGetNullifiedTickets = myContext2.getXmlHolder ("getNullifiedTickets - Request 1#Response")

holderGetNullifiedTickets.namespaces["bilhete"] = "http://bilhete.ic.cp.fujitsu"
def ticketNo2 = holderGetNullifiedTickets[ "//bilhete:getNullifiedTicketsReturn" ]

log.info "Numero bilhete 2: $ticketNo2"

if (!ticketNo2.contains(ticketNo1)) {
 com.eviware.soapui.support.UISupport.showInfoMessage(
    "O bilhete " + ticketNo1 + " nao se encontra entre os bilhetes anulados manualmente.\n" +
    "Por favor verifique a data do relatorio nas propriedades do teste");
}

// Garantir que a data de "getNullifiedTickets - Request 1" Γ© um dia anterior Γ  data da volta do askPlaces original
assert ticketNo2.contains(ticketNo1)
+2
source

Source: https://habr.com/ru/post/1705779/


All Articles