Forum Discussion
Other field names include:-
FileName string
Status string
UploadedBy string
PurchaseDate date-time
Currency String
Just pass required value to "getPropertyValues".
- nmrao8 years agoChampion Level 3
Here is the better version of the script which handle multiple properties without hassle.
All you need to do is just add the property name to below (example given, look for below statements in the script)
//ATTENTION: add the list of property names
def userList = ['transactionId', 'uploadedBy', 'purchaseDate']
https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/json/CheckOrderOfMultiProperties.groovy - bmcim1238 years agoOccasional Contributor
You are the best. THANK-YOU SO VERY MUCH FOR YOUR TIME AND EFFORT HELPING ME TODAY :-)
- bmcim1238 years agoOccasional Contributor
Hi
I can only sort on one property at a time, so one API call per sort, example API calls, sort by TransactionId Ascending/sort by DocumentId Descending etc etc. I am assuming I change the userList (as per your script) accordingly?
Can I ask you to add a few brief comments to the script so that I understand it better, if you have the time. Thank-you so very much.
- bmcim1238 years agoOccasional Contributor
Hi
I am having difficulties trying to get the script to work
Here is the JSON RESPONSE for my API. I need to verify the fileName property is in ascending order and in a separate test/assertion descending order
ASCENDING ORDER:-
"results": [
{
"trackingEntryId": 752,
"documentId": 741,
"fileId": 731,
"fileName": "1000rows.xlsx",
"status": "Success",
"uploadedBy": "Smith, Will",
"uploadedDate": "2017-06-28T15:58:33.3463573",
"transactions": 1000
},
{
"trackingEntryId": 753,
"documentId": 742,
"fileId": 732,
"fileName": "700rows.xlsx",
"status": "Success",
"uploadedBy": "Smith, Will",
"uploadedDate": "2017-06-28T16:02:00.7279932",
"transactions": 700
},
{
"trackingEntryId": 643,
"documentId": 632,
"fileId": 623,
"fileName": "a73afef9-6af3-46f6-8084-059614bd523e.xlsx",
"status": "Success",
"uploadedBy": "Sinatra, Frank",
"uploadedDate": "2017-06-27T09:26:32.0337874",
"transactions": 1
},*Can you add comments to your script as i am unsure of where you are getting the values from/cannot get the script to work.
THANKS
- bmcim1238 years agoOccasional Contributor
- bmcim1238 years agoOccasional Contributor
In particular, what is the following statement doing?
def getPropertyValues = { prop -> json.results."$prop"
Related Content
- 2 years ago
- 10 months ago
Recent Discussions
- 5 hours ago
- 17 days ago