ContributionsMost RecentMost LikesSolutionsExtracting value from XML element with multiple attributes using Groovy Hello, I want to extract the base64 encoded value of the XML element below to decode it and store the file locally. ......... <ZKN:inhoud StUF:bestandsnaam="mail1684835925155.txt" xmime:contentType="text/plain" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">VmFuOm5vcmVwbHkua.........gT2lyc2Nob3QK</ZKN:inhoud> ......... I am extracting the element using def docInhoudGroup = context.expand( '${geefZaakdocumentLezen_Lv01 - dundee - 623#Response#declare namespace ZKN=\'http://www.egem.nl/StUF/sector/zkn/0310\'; //ZKN:edcLa01[1]/ZKN:antwoord[1]/ZKN:object[1]/ZKN:inhoud[1]}' ) This results in object docInhoudGroup: And I am not successful in assigning the base64 encoded value to a new variable for further processing. I am able to extract the value of subelement 'StUF:bestandsnaam' of 'ZKN:inhoud' but as stated not the value of element 'ZKN:inhoud': def docFileName = context.expand( '${geefZaakdocumentLezen_Lv01 - dundee - 623#Response#declare namespace StUF=\'http://www.egem.nl/StUF/StUF0301\'; declare namespace ZKN=\'http://www.egem.nl/StUF/sector/zkn/0310\'; //ZKN:edcLa01[1]/ZKN:antwoord[1]/ZKN:object[1]/ZKN:inhoud[1]/@StUF:bestandsnaam}' ) Hope someone can give me a hint. Kind regards Re: REST Response: executing several teststeps for every object in REST response. How? giovanni_favara That did the trick. This DOES work: ${Query- GET by bsn#Response#$['results'][${#TestCase#loopCount}]['uuid']} ('Daag meneer' -> 'Geachte heer' or 'Hallo meneer' but it is too formal on a community) 😉 Re: REST Response: executing several teststeps for every object in REST response. How? KarelHusa works like a charm! Thanks! Re: REST Response: executing several teststeps for every object in REST response. How? Hi giovanni_favara, Thanks for your clear explanation! I have defined a Custom Test Case Property 'loopCount'. In a Groovy script i assign a value to this property: testRunner.testCase.setPropertyValue( "loopCount", "0" ) But now i am struggling with using this property 'loopCount' in the script that determines the value of the Request parameter UUID_REF. (see second screenprint in my initial Question) This doesn't work: ${Query Zaken - GET by bsn#Response#$['results'][${loopCount}]['uuid']} What am doing wrong? Kind regards, Maarten REST Response: executing several teststeps for every object in REST response. How? GOAL Execute several Test steps (GET requests) for every Object in a REST Query Response. SCENARIO I want to build a Functional Test 1. Execute GET Query request that will have several results in the response (there is a "count" element in the response with the number of results) 2. For every result in the response i want to execute several GET requests to obtain the details of each Result WHAT I AM TRYING 1. Store the value of "count" in a Property so i know how many loops i have to perform 2. Define another Property 'loopCount' that will count the number of loops 3. Use the property 'loopCount' to refer to elements of a certain Result Example: In one of the Test Steps a Request proprerty is used that refers to the first Result: ${Query Zaken - GET by bsn#Response#$['results'][0]['uuid']} I was thinking to make this dynamically using the 'loopCount' property. ${Query Zaken - GET by bsn#Response#$['results'][<some reference to property loopCount>]['uuid']} QUESTIONS 1. Is this the way to go or are there nicer/better solutions possible? 2. How can i make a dynamically reference to a certain Result in the list with Results in subsequent GET requests? Kind regards, Maarten SolvedRe: How define testscenario for REST requests using values of previous response as resource path. Thanks for the clear step-by-step explanation! Maarten How define testscenario for REST requests using values of previous response as resource path. Hello, GOAL: My goal is to functional test the available REST services using a scenario with several steps. Each step uses values from the response of previous teststeps. SCENARIO: - start scenario with a GET with query parameter : http://localhost:8080/ztcplus-rt/api/v1/zaken/query?bsn=13 - in the response there will be 1 or more 'Zaken' "results" : [ { "identificatie" : "077214954", "omschrijving" : "Test hack bsn 2", "resultaat" : "http://localhost:8080/ztcplus-rt/api/v1/zaken/statussen/55bef47c-5b8d-4d08-aa84-6cee7af4b967", "startdatum" : "06-04-2022", "url" : "http://localhost:8080/ztcplus-rt/api/v1/zaken", "uuid" : "583cb12f-be34-45fd-8bd7-a2aa7663a3df", "zaaktype" : "http://localhost:8080/ztcplus-rt/api/v1/catalogi/zaaktypes/36f0fb51-5e71-401e-9650-6721fb3af34d" } - the next teststep is a GET referencing the uuid delivered in the response of the previous request: http://localhost:8080//ztcplus-rt/api/v1/zaken/583cb12f-be34-45fd-8bd7-a2aa7663a3df QUESTION How can i create the second teststep? How can i reference the UUID in the Resource path of the GET request? See attached screenprint Kind regards, Maarten Maarten SolvedRe: ReadyAPI 3.3.2 - it doesn't close (waiting for 30 minutes now) I created a support case. The projects that were on a network drive were causing the long closing time. This was the answer of support and what solved my problem: "In this case, I suggest that you uncheck the "Preference/UI/Normalize line-break" option in ReadyAPI. After this, save your projects to the network drive. ReadyAPI 3.3.2 - it doesn't close (waiting for 30 minutes now) Good morning, I searched the community and found similar problems but no applicable solutions. What is happening: - i start ReadyAPI and open a few projects (on my local drive and on some network location) - without changing anything i close ReadAPI - ReadyAPI doesn't close - during this closing process i cannot click on anything in ReadyAPI. so it looks as if it is trying to close. Last week, when i was waiting for ReadyAPI to close, i cancelled ReadyAPI via TaskManager of Windows and that resulted in projects i couldn't open anymore in ReadyAPI. What to do? EDIT: this message states the same problem. I will try the solution given there: https://community.smartbear.com/t5/SoapUI-Open-Source/SoapUI-Pro-GUI-does-not-exit-unless-i-select-Exit-Without-Saving/td-p/164302 Kind regards, Maarten SolvedReadyAPI 3.3.1 is not understanding my code to add days to a date (version 3.1.0 did!) with version 3.1.0 this was working perfectly in XML request (adding 10 days to systemdate): <ZKN:einddatumGepland>${=new java.text.SimpleDateFormat("yyyyMMdd").format(new java.util.Date()+10)}</ZKN:einddatumGepland> with version 3.3.1 the date-value is not added to the XML. Instead some error text is added: No signature of method: java.util.Date.plus() is applicable for argument types: (Integer) values: [10] Possible solutions: parse(java.lang.String), split(groovy.lang.Closure), is(java.lang.Object), use([Ljava.lang.Object;), wait(), What's changed or what am i missing? Kind regards, Maarten Rutten Solved