ContributionsMost RecentMost LikesSolutionsRe: How can I pass a parameter from XML Response tag in a new GET XML Request in Soap UI? To update, I just got some help and now I am able to call the XML Endpoints appending the RequestNumber through Property Transfer. http://host:port/path/${#TestSuite#TSreqNum} Thanks to everyone. How can I pass a parameter from XML Response tag in a new GET XML Request in Soap UI? I am using SoapUI version 5.3.0 My Application have a couple of RESTful APIs. Initially I am sending json request to a WebService and getting back the following XML Response: <StartDataExtractResult xmlns="http://schemas.datacontract.org/2004/07/AriaTechCore" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <StatusCode>1</StatusCode> <StatusText>success</StatusText> <RequestNumber>396</RequestNumber> </StartDataExtractResult> As soon as <RequestNumber> tag is generated. I have to access to 2 more XML EndPoints (where the value of <RequestNumber> is appended) to know the Status as below: A. http://quickextract.quickaudit.in/webs/quickextract.svc/GetExtractionDetails/396 & B. http://quickextract.quickaudit.in/webs/quickextract.svc/GetRequestStatus/396 As of now, I have created the 2 seperate TestSteps for the above mentioned XML Endpoints: A. http://quickextract.quickaudit.in/webs/quickextract.svc/GetExtractionDetails & B. http://quickextract.quickaudit.in/webs/quickextract.svc/GetRequestStatus Now I need to append the value within <RequestNumber> tag from previous Step into the next GET Request to get back a response from the WebServices. Update: I have created a 'Property Transfer' at Testsuite level as "TSreqNum". This 'Property Transfer' is getting updated as per the initial Response. But I am not sure how would I append "TSreqNum" to construct the complete GET Request as: http://quickextract.quickaudit.in/webs/quickextract.svc/GetExtractionDetails/TSreqNum Can anyone help me out please? SolvedRe: How can I assert a json parameter in Request with a XML response through Script Assertion in Soap UI HKosovaThanks a ton for the suggestion & help. All the 3 of your suggestions worked well for Script Assertion. Regards Dev Re: How can I assert a json parameter in Request with a XML response through Script Assertion in Soap UI HiMaximStanovovThanks for your suggestion. As you suggested. I have done the following: 1. Added a TestStep by the nameProperty List and a Property "databaseName" with in. 2. Added a Groovy Script by the name "Groovy Property" and added the following code: String testString = ${TARGET_DB} testRunner.testCase.setPropertyValue( "databaseName", testString ) def getLocalPropValue = testRunner.testCase.getPropertyValue("databaseName") log.info(getLocalPropValue) testRunner.testCase.testSteps["Properties"].setPropertyValue( "databaseName", testString ) I have observed when I pass a simple string initially e.g "abcde" the Groovy sets the value ofProperty "databaseName" to "abcde". But when ever I pass the following it gives me an error as follows: 1. '${#TestCase#TARGET_DB}' Then I can see that the Groovy gives me a similar output as${#TestCase#TARGET_DB} Even now I can see the"databaseName" property is being set to${#TestCase#TARGET_DB} Now, I have modified my Script Assertion as follows: context.testCase.getPropertyValue("TARGET_DB") context.testCase.properties["TARGET_DB"].value if(nodeRequestNumber=='${TARGET_DB}') { log.info "Pass" } else { log.info "Fail"} The result I am getting is still Fail. As the Assertion is in a for loop so I am not getting any error though but log message says Fail. Any moresuggestion please? Re: How can I assert a json parameter in Request with a XML response through Script Assertion in Soap UI HKosovaThanks for your suggestion. As you mentioned I did the following: Case A: Added this line to my script before comparison : context.expand('${#TestCase#TARGET_DB}') But still the error comes as:No such property: TARGET_DB for class: Script8 Case B: Added these 2 lines to my script before comparison : context.testCase.getPropertyValue("TARGET_DB") context.testCase.properties["TARGET_DB"].value But still the error comes as:No such property: TARGET_DB for class: Script9 Case C: XPath Match assertion Yes, it worked. A big thanks to you again. But I will always like to know, why the variable was not accessible from Script Assertion. My other assertions are still through Script Assertion. How can I assert a json parameter in Request with a XML response through Script Assertion in Soap UI I am using SoapUI version 5.3.0 My Application have a couple of RESTful APIs. I am sending multiple request to a WebService in the form of a json request as below: { "app_key":"i8gAVDwcAq40n2kAv6Ox+w==", "targetDB":"${#TestCase#TARGET_DB}", "createNew": "true" } The response from the WebService is as follows: <StartDataExtractResult xmlns="http://schemas.datacontract.org/2004/07/AriaTechCore" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <StatusCode>1</StatusCode> <StatusText>success</StatusText> <RequestNumber>101</RequestNumber> </StartDataExtractResult> I am using a Groovy Script to generate a dynamic name for "targetDB" as follows: def targetdb = ((context.expand('${#TestCase#TARGET_DB}') ?: 100) as Integer) + 1 log.info "Target db for current request : ${targetdb}" context.testCase.setPropertyValue('TARGET_DB', targetdb.toString()) I have designed my Test data in such a way that passing the parameter of the 'targetdb' as "101" will result in the RequestNumber tag set to "101" in the response. Now I want to add an assertion to check if the RequestNumber tag contains the same value as of the variable "${#TestCase#TARGET_DB}" (sent in Request json) . To achieve that I wrote a Script Assertion as follows: def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def holder = groovyUtils.getXmlHolder(messageExchange.responseContent) holder.namespaces["ns1"] = "http://schemas.datacontract.org/2004/07/AriaTechCore" def nodeRequestNumber = holder.getNodeValue("//ns1:RequestNumber") assert nodeRequestNumber != null if(nodeRequestNumber=="${TARGET_DB}") { log.info "Pass" } else { log.info "Fail"} But I am getting an error as: No such Property: TARGET_DB for class: Script 53 Can any one help me out please? SolvedRe: How can I send multiple requests (same request) by a for loop to the same WebService through SoapUI? Yes, you are correct Sir. I have asked this question in both the forums for a quick help. Re: How can I send multiple requests (same request) by a for loop to the same WebService through SoapUI? Thanks for the suggestion. How can I send multiple requests (same request) by a for loop to the same WebService through SoapUI? Hi Everyone, I am pretty new to SoapUI tool. I am using SoapUI version 5.3.0My Application have a couple of RESTful APIs. I have to send arequest to the WebService in the form of a json request as below: { "app_key":"i8gAVDwcAq40n2kAv6Ox+w==", "targetDB":"100", "createNew": "true" } As of now I am able to send single request in each step and get back a satisfactory response as below: <StartDataExtractResult xmlns="http://schemas.datacontract.org/2004/07/AriaTechCore" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <StatusCode>1</StatusCode> <StatusText>success</StatusText> <RequestNumber>68</RequestNumber> </StartDataExtractResult> My question is how can I send multiple requests (50, 100, 500) requests in a loop to the Web Server in 3 second time gap? Any help/pointers will be very helpful. Solved