We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
I dont know if this will help or not.
I was playing around with this a couple of week's ago - not specifically for work - I just hadn't used the groovy/xml/json datasources before so started to play around with the functionality.
I had a LOT of trouble with json datasource, perhaps I was doing something wrong (I also find xpath easier to read than jsonpath) - but I found setting it up was a lot easier if I used an XML datasource instead.
Despite the fact that the response of the request that I was using to populate my datasource was actually .json - I added the XML datasource in and specified the 'source property' dropdown on the XML datasource as 'ResponseAsXML'.
I was then able to build up a datasource of attributes successfully sourced from the response without too much trouble.
Just a suggestion,
Cheers,
richie
Can we accomplish this with only the JSON DataSource and not a groovy script? I have some testers who aren't that adept at groovy.
I set my RowPath as $[*] and my Column Path as the values for the JSON names I want to pull in. This gets 0 rows.
When I set my RowPath as $[0] with the same ColumnPath I get 1 row. Why can't I use $[*] to get all rows to populate my DataSource? Why do I have to use groovy to accomplish this?
I dont know if this will help or not.
I was playing around with this a couple of week's ago - not specifically for work - I just hadn't used the groovy/xml/json datasources before so started to play around with the functionality.
I had a LOT of trouble with json datasource, perhaps I was doing something wrong (I also find xpath easier to read than jsonpath) - but I found setting it up was a lot easier if I used an XML datasource instead.
Despite the fact that the response of the request that I was using to populate my datasource was actually .json - I added the XML datasource in and specified the 'source property' dropdown on the XML datasource as 'ResponseAsXML'.
I was then able to build up a datasource of attributes successfully sourced from the response without too much trouble.
Just a suggestion,
Cheers,
richie
Thanks Richie! That fixed it for me. This makes me think that the JSON DataSource has a bug in it. The XML DataSource works just like I thought the JSON DataSource would. I have my workaround now that is less complex than the Groovy DataSource.