ContributionsMost RecentMost LikesSolutionsRe: GraphQl request : extra quotes added to the Query Variables when the QUery Variables is a property Hello _Oliver_ After four years, this is still occurring... :( I ran upon your stated issue today... A work around is to give a functional shell structure of the Query Variables and use property expansion within that shell... instead of the only Query Variables content of: ${#TestSuite#queryVar} Use this in the Query Variables (after you define queryUUID test suite property): {"testId": "{${#TestSuite#queryUUID}}"} So that the structure is maintained but you parameter replace just the portion that is needed to fulfill the request. Regards, Todd Re: Create Selenium Tests in ReadyAPI Hello Kpm , I have never had good results putting my jar files in the location Smartbear says to... I do not use: ReadyAPI/bin/ext Use: ReadyAPI/lib Where all the other jar files are stored. Exit ReadyAPI and delete or move the selenium jar files you put in ReadyAPI/bin/ext to ReadyAPI/lib then restart ReadyAPI. Remember to rename the originality installed guava jar to guava.ojaro. After you restart ReadyAPI with those changes you should be relieved of the error. Regards, Todd Re: Passing variable as index in property, Groovy Hello jrziggy It looks like this is a little trick situation... you need to expand the 'randomIndex' variable before the whole datasource reference is parameter expanded... The context.expand is operating on a string, so just manipulate it a little bit to get your number in there instead of the variable that references it... be mindful of single quote use versus double quote use below. Simple parameter replacement occurs when double quotes are used. This sample just gets that variable replaced before the whole context.expands the full parameter. result = context.expand( '${DataSourceStationNumber#STATION_NUM::' + "$randomIndex" + '}' ); Regards, Todd Re: Testing RESTful APIs with complex request - Emmanuel Katto Uganda Hello emmanuelkatto23 I have a technique to share but it is not specific to XPath or JSONPath... The technique I employ is to use JsonSlurper (https://docs.groovy-lang.org/latest/html/gapi/groovy/json/JsonSlurper.html). It is very efficient and has allowed me to interrogate every complex JSON structure that I have explored. I only use a groovy test step to make my own assertions from other test step results that contain the actual invoke of an API from an 'HTTP Request' test step and not a 'REST Request' test step. I prefer HTTP Request over Rest Request so that I don't have to import an API to use it (less baggage in my mind). Sample stand alone JsonSlurper code with assert to copy/paste/run into groovy test step... import groovy.json.JsonSlurper; log.info 'Test Step "' + testRunner.runContext.currentStep.name + '" start...'; log.info ""; def String jsonStr = """ { "step_list": [ { "end_date": "2035-09-01T00:00:00", "payments": 12, "sequence": 1 }, { "end_date": "2035-09-01T00:00:00", "payments": 67, "sequence": 2 } ] } """; def jsonSlurper = new JsonSlurper(); def jsonObj = jsonSlurper.parseText(jsonStr); log.info "jsonObj=$jsonObj"; def expectedSize = 2; assert jsonObj.step_list.size() == expectedSize, "Expected step_list size to be $expectedSize but it is = ${jsonObj.step_list.size()}"; log.info "jsonObj.step_list.first()=${jsonObj.step_list.first()}"; log.info "jsonObj.step_list.last()=${jsonObj.step_list.last()}"; def datePattern = "yyyy-MM-dd"; jsonObj.step_list.each { step -> log.info ""; log.info "step=${step}"; def stepDate = Date.parse(datePattern, step.end_date); log.info "stepDate=${stepDate}"; Date lowDate = new Date("08/15/2020"); Date highDate = new Date("10/15/2040"); def nowDate = new Date(); assert stepDate > lowDate, "Expected the step date to be greater than $lowDate but it is $stepDate"; assert stepDate < highDate, "Expected the step date to be less than $highDate but it is $stepDate"; assert stepDate > nowDate, "Expected the step date to be greater than today but it is $stepDate"; def expectedPaymentMinimum = 10; assert step.payments > expectedPaymentMinimum , "Expected the step payments to be greater than $expectedPaymentMinimum but it is ${step.payments}"; if (step == jsonObj.step_list.first()) { log.info "step.sequence=${step.sequence}"; def expectedFirstSequence = 1; assert step.sequence == expectedFirstSequence, "Expected the first step sequence to be $expectedFirstSequence but it is = ${step.sequence}"; }; if (step == jsonObj.step_list.last()) { log.info "step.sequence=${step.sequence}"; def expectedLastSequence = 2; assert step.sequence == expectedLastSequence, "Expected the last step sequence to be $expectedLastSequence but it is = ${step.sequence}"; }; }; log.info ""; log.info 'Test Step "' + testRunner.runContext.currentStep.name + '" done...'; Regards, Todd Re: 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