Use Datasink to pull mutliple nodes with the same name.
Hey everyone,
I am using a DataDriven test to input employee User ID's and Company ID's into a request and then trying to pull the following XML nodes of entityType and entityID with DataSink to create a report.
Is there a way to pull all of the "entityType" and corresponding "entityId" when the number of "entityAccess" nodes changes depending on the User ID and Company ID used?
So far, I can only pull them if I use the Xpath to pull a specific entity type:
${EmployeeEntityAccess - Conv#Response#declare namespace ns1='http://fwdco.com/api'; //ns1:getEntityAccessResponse[1]/ns1:return[1]/ns1:entityAccess[1]/ns1:entityType[1]}
Here is a sample XML response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getEntityAccessResponse xmlns="http://fwdco.com/api">
<return>
<errorCode>0</errorCode>
<errorMessage/>
<entityAccess>
<entityType>Department</entityType>
<entityId>167SCL</entityId>
</entityAccess>
<entityAccess>
<entityType>Department</entityType>
<entityId>168PHE</entityId>
</entityAccess>
<entityAccess>
<entityType>Location</entityType>
<entityId>1</entityId>
</entityAccess>
<entityAccess>
<entityType>Location</entityType>
<entityId>2</entityId>
</entityAccess>
<entityAccess>
<entityType>WorkGroup</entityType>
<entityId>DTLV18</entityId>
</entityAccess>
</return>
</getEntityAccessResponse>
</soap:Body>
</soap:Envelope>
It looks like you have two DataSource steps, one for each entityId and entityType? This is not necessary. You should have one XML DataSource that can provide both. That might be causing the issue you are seeing.