[RESOLVED] extract data from nodes depending on the condition
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2009
01:46 PM
10-15-2009
01:46 PM
[RESOLVED] extract data from nodes depending on the condition
Hi,
In the below response, I want to search for Commentary and then if I find it assert that its commentary and then extract ID,SpotID and then i need to pass as input to another request
I have such nodes with variety other than commentary and there could be more than one commentary elements with different ID and SpotID.
4
true
2009-10-15T16:00:53.3833256-04:00
2009-10-15T16:00:53.3833256-04:00
faceoff_u3rd_logo_1
1
18
commentary ------- This is what i need to assert.
logo_soundoff_1
1
Primary
83
-40
83
190
107
1
Attaching the whole response
In the below response, I want to search for Commentary and then if I find it assert that its commentary and then extract ID,SpotID and then i need to pass as input to another request
I have such nodes with variety other than commentary and there could be more than one commentary elements with different ID and SpotID.
Attaching the whole response
15 REPLIES 15
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2009
01:46 PM
10-15-2009
01:46 PM
if you guys want whole response i can email you
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2009
01:33 AM
10-16-2009
01:33 AM
Hello,
Hm...You should use groovy test step to extract all values you need ( id, spotId ) and put them all in property at test case level, check this: http://www.soapui.org/userguide/functional/groovystep.html. Than you should use property transfer step(http://www.soapui.org/userguide/functional/propertytransfers.html) or groovy step to go trough extracted values and set parameters for request.
Hope this helps, let me know
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Hm...You should use groovy test step to extract all values you need ( id, spotId ) and put them all in property at test case level, check this: http://www.soapui.org/userguide/functional/groovystep.html. Than you should use property transfer step(http://www.soapui.org/userguide/functional/propertytransfers.html) or groovy step to go trough extracted values and set parameters for request.
Hope this helps, let me know
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2009
02:32 PM
10-18-2009
02:32 PM
got this working....
spotID = holder.getDomNodes("//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/aetgt:SpotID")
spotListID = holder.getDomNodes("//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/../../aetgt:ID")
once we get nodes based on the condition we need to getvalue using getNodeValue.
spotID = holder.getDomNodes("//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/aetgt:SpotID")
spotListID = holder.getDomNodes("//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/../../aetgt:ID")
once we get nodes based on the condition we need to getvalue using getNodeValue.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2009
03:04 PM
10-18-2009
03:04 PM
I got the spotID and ID using the above steps.
I have spotID = [1,1]
SpotListID = [4,5]
How do i pass these to datasource from the groovy script result? I want to loop on SpotListID.
I have spotID = [1,1]
SpotListID = [4,5]
How do i pass these to datasource from the groovy script result? I want to loop on SpotListID.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2009
04:20 PM
10-18-2009
04:20 PM
Hi Usha,
if you want you create a DataSource/DataSourceLoop construct from values in a message response, try the XML DataSource which allows you to do just that using xpath expressions for row / property selection.
Does that help?
regards!
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
if you want you create a DataSource/DataSourceLoop construct from values in a message response, try the XML DataSource which allows you to do just that using xpath expressions for row / property selection.
Does that help?
regards!
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2009
07:00 AM
10-19-2009
07:00 AM
Hi Ole,
I am getting values using XML Datasource.
But the result looks likes this.
ID SpotID
4
5
1
1
But my expected result should be
ID SpotID
4 1
5 1
How to achieve the above result?
my rowpath expression is
declare namespace aetgt='http://musicchoice.com/services/games';
//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/../..,
//aetgt:GetSpotListsResponse/aetgt:GetSpotListsResult[1]/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']
column path expression is
aetgt: ID/text()
aetgt: SpotID/text()
I am getting values using XML Datasource.
But the result looks likes this.
ID SpotID
4
5
1
1
But my expected result should be
ID SpotID
4 1
5 1
How to achieve the above result?
my rowpath expression is
declare namespace aetgt='http://musicchoice.com/services/games';
//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/../..,
//aetgt:GetSpotListsResponse/aetgt:GetSpotListsResult[1]/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']
column path expression is
aetgt: ID/text()
aetgt: SpotID/text()
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2009
03:22 PM
10-19-2009
03:22 PM
Hi!
hmm.. can you attach the corresponding response message?
regards,
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
hmm.. can you attach the corresponding response message?
regards,
/Ole
eviware.com
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2009
06:24 PM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2009
06:16 AM
10-22-2009
06:16 AM
Try doing something like this:
rowpath:
declare namespace aetgt='http://musicchoice.com/services/games';
//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/../..
columnpath:
aetgt: ID/text()
aetgt:Spots/aetgt:Spot/aetgt: SpotID/text()
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
rowpath:
declare namespace aetgt='http://musicchoice.com/services/games';
//aetgt:GetSpotListsResult/aetgt:spotlists/aetgt:Spotlist/aetgt:Spots/aetgt:Spot[aetgt:Variety='commentary']/../..
columnpath:
aetgt: ID/text()
aetgt:Spots/aetgt:Spot/aetgt: SpotID/text()
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
