ContributionsMost RecentMost LikesSolutionsRe: SoapUi Groovy conditional property transfer Hello smilnik Here is groovy code for your example. It can be dropped into a "Groovy Script" test step. It performs property transfer to a value in a "Properties" test step within the same test case. There is probably better code examples to 'find' a value in xml, but this was handy. Regards, Todd log.info "Test Step ${testRunner.runContext.currentStep.name} start..."; xmlStr = """ <catalog> <OfferItem> <OfferItemID>not_id_1</OfferItemID> <Service> <ServiceDetails> <PaxJourneyRefID>PJ1</PaxJourneyRefID> </ServiceDetails> </Service> <Service> <ServiceDetails> <ServiceDetailsRef> <PSRID>S1</PSRID> <ServiceID>SR_MAYBE</ServiceID> </ServiceDetailsRef> </ServiceDetails> </Service> </OfferItem> <OfferItem> <OfferItemID>wanted_id_1</OfferItemID> <Service> <ServiceDetails> <PaxJourneyRefID>PJ1</PaxJourneyRefID> </ServiceDetails> </Service> <Service> <ServiceDetails> <ServiceDetailsRef> <PSRID>S1</PSRID> <ServiceID>SR_YES</ServiceID> </ServiceDetailsRef> </ServiceDetails> </Service> </OfferItem> <OfferItem> <OfferItemID>not_id_1</OfferItemID> <Service> <ServiceDetails> <PaxJourneyRefID>PJ1</PaxJourneyRefID> </ServiceDetails> </Service> <Service> <ServiceDetails> <ServiceDetailsRef> <PSRID>S1</PSRID> <ServiceID>SR_NO</ServiceID> </ServiceDetailsRef> </ServiceDetails> </Service> </OfferItem> </catalog> """; def foundValue = ''; def findStr = 'SR_YES'; def catalog = new XmlSlurper().parseText(xmlStr); catalog.OfferItem.Service.ServiceDetails.ServiceDetailsRef.ServiceID.eachWithIndex {valueStr, indx -> log.info "indx=$indx valueStr=$valueStr"; if (valueStr == findStr) { foundValue = catalog.OfferItem.OfferItemID[indx].toString(); log.info "foundValue=$foundValue"; }; }; testRunner.testCase.testSteps['Properties'].setPropertyValue('offerItemID', foundValue); log.info "Test Step ${testRunner.runContext.currentStep.name} done..."; Re: How to Generate Data correctly using datasource in readyAPI Hello @RaghavanG maybe this code snippet can help (make sure to adjust line 1 to be whatever the name of your datasource is)... def row = testRunner.testCase.testSteps["Data Source 2xyz"].currentRow; def testDataMap = [TC01:'Pass', TC02:'Fail', TC03:'Fail', TCNN:'Pass']; if ( (row + 1) <= testDataMap.size() ) { result["TestCaseName"] = testDataMap.entrySet()[row].getKey(); result["TestStatus"] = testDataMap.entrySet()[row].getValue(); }; Regards, Todd Re: Boolean check Hello armygrad Is this a json or groovy question? Your first line defining the 'check' variable starts the whole thing off on a bad foot... Unless you are meaning to do some tricky groovyish stuff, i apologize... I don't know what groovy does when you mix data types... line one you are setting a boolean type to a string type... If you purposely add the boolean type why set to string value? You might get more consistent results with exacting code: . . . check = false; if (response.contains("1234") ) { check = true; }; log.info "check=$check"; . . . Regards, Todd Re: ReadyAPI Performance on Intel Core i7 Laptops - User Experiences Wanted! Hello @emilyawalker123, I can only comment on API testing on i7-9850H... In general it performs fine. I do not do virtualization however. ReadyAPI, like any other software application runs as well as it can on the hardware you have... I think you are placing too much emphasis on the cpu instead of considering the other components of a computer. I think the available RAM has as much to do with how ReadyAPI acts as CPU. The i7 laptop supplied by my company has 32 GB installed and I have never had an issue. It works and I don't wait. :) For API testing, I am going to speculate that is not very cpu intensive to begin with... You formulate a request with ReadyAPI and send it off your computer to be processed. The time it takes to process the api has nothing to do with your computer. At no point have I ever thought ReadyAPI was sluggish or in need of tweaking for better performance. An api test run on a 14 year old AMD Phenom processor yields the same results as a 2 year old Intel i7. Just buy what you can afford and don't worry about it. If you are so concerned with top performance why stop at an i7 when there are better i9's or Ryzen Threadripper? Regards, Todd Re: Can an end user move jar files to SoapUI 5.5? -- Help Please! Hello @OMF-SC You are out of luck if administrator is not your friend. Did IT department install SoapUI for you? If it was installed for you, then you are probably really out of luck... Windows does not like non-administrators messing with C:\Program Files. If you were the one who installed SoapUI, you have control on where to install it since it is a prompt during installation. Do not install it in C:\Program Files... Try some other location that is: 1) On a different drive than 'C' if available. 2) Not in a 'Program Files' folder. i.e. D:\Apps\SmartBear\SoapUI-5.7.2 Getting away from administrator (and Microsoft controlled) location should allow you to move files easier (i hope) :) Regards, Todd Re: Unable to dump file upon executing Rest Request in Soap UI Hello htereshchenko Sorry, I could not reproduce the non population of a dump file... I updated to the latest version of SoapUI (5.7.2). I specified a dump file for a REST Request I executed the test step that was the REST Request I got content in the file that I specified as the dump file (json response only, not the whole content of the raw tab). The only thing I noticed that was different from your picture is that the Encoding in the Request Properties is UTF-8. Also, Max Size was 0 instead of 1 million. When I removed UTF-8 and set Max Size to 1000000, I still got output to file. 😞 Are you sure you have write capability to the drive and folder you specified? Maybe try a different folder and see what happens. Also see if anything displays in the SoapUI log or error log that could shed some light on why data is not written. Sorry I could not help your situation. Regards, Todd Re: Unable to dump file upon executing Rest Request in Soap UI Hello htereshchenko What seems to be the problem? Do you get some error message that states you could not dump a response file? What is your dump file and where did you specify it? There are a few locations on a response for a "dump" file... Right clicking in the "JSON" tab of the response allows you to "Save as..." Is that what you consider a dump file? Right clicking in the "http log" along the bottom of the generally available tabs yields an "Export to File" menu item. Is that what you consider a dump file? We can advise with a little more help from you on where you specified the dump file at. Running your test from a command line will produce a file of request/response for every RESTfull request in the test that is run. You could consider those a dump file. Those are the locations for dump files that I can think of. Whenever I need a dump file, I choose to write a groovy script that takes the response (or raw response) and write it to a file... def response = context.expand( '${HTTP Request Step#Response}' ); log.info "response=>" + response.toString() + "<"; {write response string to file} Regards, Todd Re: could'n paste url in initial wsdl. right click- no paste option. ctrl also doesn't work in this line Hello dear Even though right click does not work, the default windows paste key sequence does... {Shift}{Insert} keypress will paste your url if it is in the clipboard. The "Browse..." button should work to get to a saved wsdl files too. Don't forget to add '?' to the end of SOAP WSDL Url. That added character is often needed if I remember. Regards, Todd Re: How do I set the status of a Script Assertion? Hello Cleo-Juniper Your question seems to be getting pretty deep for handling the response of a Script Assertion. I don't know your intent on setting this, but I will assume you are new to SoapUI and are trying too hard to make work for yourself. 🙂 The result of the outcome of one line of code will set the status of a script assertion... You do not have to code the plumbing to get a status (unless you want to). Use the 'assert' statement: assert evalEndDate > nowDate, "Expected EndDate to be greater than now"; If the result of executing the assert statement is true, then the result of the Script Assertion will be "PASSED" or similar. If the result of executing the assert statement is false, then the result of the Script Assertion will be "FAILED" or similar. Sorry if I deviated from your intent (which i had to make an assumption), but this is an answer to your title question. Regards, Todd Re: How to build SQL query using strings whose value should be retrieved from TestCase property Hello arasi_m Just to add on a little to what mrdwprice stated previously... SELECT * FROM Table1 where TagId = ${#TestCase#TagId} and Time > '${#TestCase#FromTimeUTC}' and Time < '${#TestCase#ToTimeUTC}' A nice feature that ReadyAPI provides is to 'right-click' in most any data entry field and choose the "Get Data" menu item. It allows you to gather the correct parameter replacement value from virtually anywhere in your project. In this case, doing that and picking the values from your Test Case area will get you the properties you can use. Regards, Todd