Hello nmrao
Your right, maybe I did not express myself correctly
Let me provide more info about my problem that lets you and the SOAP community have a full vision of my problem.
I need to extract a param value correct (it has to meet my conditions) form a response and populate it to a testCase property called PricedCategoryCode
The param to be populated is the @@PricedCategoryCod that meet the condition: @BreakdownType'.text(). == "02 A" (note that could be more than one @PricedCategoryCode that meet this condition but i just need the first one that meet @BreakdownType'.text(). == "02 A"
Here is my full response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<list:getCategoryListResponse xmlns:alpha="http://www.opentravel.org/OTA/2003/05/alpha" xmlns:list="http://xxxxxxxx.com/Interfaces/CategoryList">
<alpha:OTA_CruiseCategoryAvailRS MaxResponses="72" MoreDataEchoToken="0" MoreIndicator="false" SequenceNmbr="0" Version="1.0">
<alpha:Success/>
<alpha:Warnings>
<alpha:Warning Type="3"/>
</alpha:Warnings>
<alpha:SailingInfo>
<alpha:SelectedSailing ListOfSailingDescriptionCode="6" Duration="P7N">
<alpha:CruiseLine/>
<alpha:Region RegionCode="PBC"/>
</alpha:SelectedSailing>
<alpha:InclusivePackageOption CruisePackageCode="ZEPB0742"/>
</alpha:SailingInfo>
<alpha:FareOption>
<alpha:CategoryOptions>
<alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="PT">
<alpha:PriceInfos>
<alpha:PriceInfo Amount="1909.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 C" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
<alpha:PriceInfo Amount="1909.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 C" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
</alpha:PriceInfos>
</alpha:CategoryOption>
<alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="LS">
<alpha:PriceInfos>
<alpha:PriceInfo Amount="1709.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
<alpha:PriceInfo Amount="1709.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
</alpha:PriceInfos>
</alpha:CategoryOption>
<alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="JT">
<alpha:PriceInfos>
<alpha:PriceInfo Amount="1509.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
<alpha:PriceInfo Amount="1509.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
</alpha:PriceInfos>
</alpha:CategoryOption>
<alpha:CategoryOption CategoryLocation="Deluxe" PricedCategoryCode="JS">
<alpha:PriceInfos>
<alpha:PriceInfo Amount="1309.00" BreakdownType="0201C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0201A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="01 " FareCode="C6111184"/>
<alpha:PriceInfo Amount="1309.00" BreakdownType="0202C" NCCFAmount="0.00" NonRefundableType="1" PromotionDescription="STD 2" FareCode="C6111184"/>
<alpha:PriceInfo Amount="0" BreakdownType="0202A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 A" FareCode="C6111184"/>
<alpha:PriceInfo BreakdownType="02 " FareCode="C6111184"/>
</alpha:PriceInfos>
</alpha:CategoryOption>
</alpha:CategoryOptions>
</alpha:FareOption>
<alpha:Taxes>
<alpha:Tax Amount="200.00"/>
<alpha:Tax Amount="200.00"/>
<alpha:Tax Amount="200.00"/>
<alpha:Tax Amount="200.00"/>
</alpha:Taxes>
<alpha:Fee TaxInclusive="false">
<alpha:Taxes>
<alpha:Tax Amount="0.00"/>
<alpha:Tax Amount="0.00"/>
<alpha:Tax Amount="0.00"/>
<alpha:Tax Amount="0.00"/>
</alpha:Taxes>
</alpha:Fee>
</alpha:OTA_CruiseCategoryAvailRS>
</list:getCategoryListResponse>
</soapenv:Body>
</soapenv:Envelope>
So, in this case a valid @PricedCategoryCode could be: LS, JT, JS any of them, but i just need only one to popule it to my testCase property called PricedCategoryCode to be used along the other test steps.
- This is the script assertion already implemented after your support
//Script Assertion
def categoryCode = new XmlSlurper().parseText(context.response).CategoryOption.find{
it.PriceInfos.PriceInfo.find {
it.'@BreakdownType'.text() == "02 A"
}
}.'@PricedCategoryCode'
context.testCase.setPropertyValue('PricedCategoryCode', categoryCode)
- And this is the issue when i execute the test
No signature of method: com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.setPropertyValue() is applicable for argument types: (java.lang.String, groovy.util.slurpersupport.Attributes)
values: [PricedCategoryCode, ] Possible solutions: setPropertyValue(java.lang.String, java.lang.String), getPropertyValue(java.lang.String)
Please, let me attach below a screen capture with my SOAPUI, testcase, script assertion and issue.
Thanks you so much nmrao for your appreciated support.