Contributions
Re: Property Transfer Conditional
Hi, I want to do the same with another Test suite, here's the assertion script : assert context.response, 'Response is empty or null' // Permet de trouver la première catégorie avec une dispo def catDispo = new XmlSlurper().parseText(context.response).'**'.find {it.name() == 'CategorieDispo' && it.Statut == O} //Récupère la catégorie et la stock dans une custom property context.testCase.setPropertyValue('CATCODE', catDispo.CategorieGroup.text()) And here the request response : <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <DispoResponse xmlns="http://www.hitech.fr/"> <DispoResult> <Demande> <StationDepart>U1194</StationDepart> <DateDepart>2020-05-18T10:00:00Z</DateDepart> <StationRetour>U1194</StationRetour> <DateRetour>2020-05-19T10:00:00Z</DateRetour> </Demande> <Categories> <CategorieDispo> <CategorieGroup>M1</CategorieGroup> <Statut>N</Statut> </CategorieDispo> <CategorieDispo> <CategorieGroup>M2</CategorieGroup> <Statut>N</Statut> </CategorieDispo> <CategorieDispo> <CategorieGroup>M3</CategorieGroup> <Statut>O</Statut> </CategorieDispo> </Categories> </DispoResult> </DispoResponse> </soap:Body> </soap:Envelope> I want to transfer the<CategorieGroup>M3</CategorieGroup> if only the statut is O Thanks !5 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.5KViews0likes3CommentsRe: Property Transfer Conditional
Oh god it's working, thanks a lot buddy ! Have a good day & stay safe !5 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes0Comments- 5 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes3Comments
- 5 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes5Comments
Re: Property Transfer Conditional
Hi Rao, then so select the first response with "True" or to select one of them randomly. The selected CodeCat goes to<hit:Categ>?</hit:Categ> Sure : s<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hit="http://www.hitech.fr/"> <soapenv:Header/> <soapenv:Body> <hit:GetDispoSurAgence> <hit:CodeOrigine>?</hit:CodeOrigine> <hit:CodeAgence>?</hit:CodeAgence> <hit:Categ>?</hit:Categ> <hit:Depart>?</hit:Depart> <hit:Retour>?</hit:Retour> </hit:GetDispoSurAgence> </soapenv:Body> </soapenv:Envelope>5 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.6KViews0likes13CommentsProperty Transfer Conditional
Hi guys, I'd like to perform a conditional Property Transfer from one response to the next request. I need to select the firstDefCategoriesDispo with the StatutDispo on true and send the CatCode associated to the next request. Here the response : <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <GetAllDispoSurAgenceV2Response xmlns="http://www.hitech.fr/"> <GetAllDispoSurAgenceV2Result> <DefCategoriesDispo> <CatId>7</CatId> <CatCode>A</CatCode> <StatutDispo>false</StatutDispo> </DefCategoriesDispo> <DefCategoriesDispo> <CatId>8</CatId> <CatCode>B</CatCode> <StatutDispo>true</StatutDispo> </DefCategoriesDispo> <DefCategoriesDispo> <CatId>9</CatId> <CatCode>C</CatCode> <StatutDispo>false</StatutDispo> </DefCategoriesDispo> </GetAllDispoSurAgenceV2Result> </GetAllDispoSurAgenceV2Response> </soap:Body> </soap:Envelope> Can someone help me please ? Thanks !Solved5 years agoPlace ReadyAPI QuestionsReadyAPI Questions3.2KViews0likes15Comments