Forum Discussion
Hi,
I tried to use it as XML Datasource. I created the properties and executed it. But the data log doesn't seem to be displaying any data although it says Got 5 rows in 3ms.
1. Is there something that needs to be done, apart from providing the row Xpath, defining property?
2. Can i use the output data values to get stored in an array?
Please suggest.
Can you share some details of what you have tried? Either your project or screen shots?
What I have done in the past is similar to this, as a high level view:
- Make a Read request that returns one object.
- Set up an XML datasource that uses XPATH to point to properties in the response from step 1.
- Example properties:
- UserName
- TimeStamp
- Identifier
- If you manually run the DataSource, you should see the data it returns in the data log window. If you do not see data, it is not configured correctly.
- Example properties:
- Set up furthe Read requests that use data from the XML Data Source
- Test steps would reference the data as ${XMLDataSource#PropertyName}
- ${XMLDataSource#UserName}
- ${XMLDataSource#TimeStamp}
- ${XMLDataSource#Identifier}
- Test steps would reference the data as ${XMLDataSource#PropertyName}
- An example test case would look like
- Read request to populate XML DataSource
- XML DataSource
- ReadRequest using Property1
- ReadRequest using Property2
- ReadRequest using Property3
- etc.
Hope that helps!
- MKV6 years agoContributor
You are correct. I did a mistake in the configuration. Using one of your earlier comment in a post (https://community.smartbear.com/t5/SoapUI-Pro/DataSource-XML-not-returning-data/td-p/147087/page/3), I corrected it and now the data is getting displayed.
Now, I want to pass this data into an array. Can you please help to do that as well.
- groovyguy6 years agoChampion Level 1
Glad you got the data getting returned. It took me awhile to puzzle that piece out my first time. :) When you say store these pieces of data in an array, what do you mean and what is the intent? I may need some examples of what you are trying to do and some sample requests / responses / etc to figure this next part out. :)
- MKV6 years agoContributor
I have a set of attributes in response which is stored in DB in JSON format. Validating if the details in DB are retrieved in response correctly is my final motive.
So, I have split the JSON data and stored it in different arrays - say attributeName, attributeId, attributeValue.
Similarly, I wanted to store the xml response attribute details in an array and finally compare both the arrays.
I have successfully did the Json data storing in array. Now, I wanted to have the response data also to be stored in array, so that i can conclude by comparing both the arrays. Please suggest.
Sample response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns4:GetAccountDetailsResponseMessage></ns4:account>
.....
<ns6:CustomCustomerAccount>
<ns3:attributes>
<ns3:attributeName>TELE</ns3:attributeName>
<ns3:attributeId>TRUE</ns3:attributeId>
<ns3:attributeValue/>
</ns3:attributes><ns3:attributes>
<ns3:attributeName>SMS</ns3:attributeName>
<ns3:attributeId>AVAILABLE</ns3:attributeId>
<ns3:attributeValue/>
</ns3:attributes></ns6:CustomCustomerAccount>
</ns4:account>
</ns4:GetAccountDetailsResponseMessage>
</soap:Body>
</soap:Envelope>
Related Content
- 5 years agounderqualified
- 3 years agogoogleid_114550
Recent Discussions
- 4 days agominhng