First are you able to import this collection into your Postman
https://github.com/liupeirong/cosmosdb-postman-collection
Once you do you will see a collection called "Query Collection - specify query in body"
All is had to do is in the environment look up on the top right of postman set my azure host and Master key and the query as put below in the body of my message
{
"query": "SELECT * FROM provider_pharmacy c WHERE c.pharmacyId = @id",
"parameters": [
{"name": "@id", "value": "xbbbbbd"}
]
}
I need the same to work from soap ui but i dont have the pre request script in groovy
This should answer all your questions
Hey @ameesh1984
right - I successfully imported the one postman collection, but couldnt import the second cos it wasnt really a collection - its just an environment config file as far s i can tell.
I've exported the postman collection and attached.
I'm about a quarter ogf the way through converting the JS to groovy. how far have you got? it would make sense if we dont want to waste time but for one of us to start at the bottom of the script and work up whilst the other works down.
This is what I've converted so far (remember postman stores properties as global variables so they;re all stored at the same level - so I've set them all to store at project level).
//Postman stores properties a global variables and there are no levels of storage in Postman. I've assumed it's best if you store them at project level, so that's what I've done
import org.codehaus.groovy.runtime.*; //needed for the date handling
// store our master key for documentdb
def mastKey = testRunner.testCase.testSuite.project.getPropertyValue("DocumentDBMasterKey");
log.info("mastKey = " + mastKey);
// store our date as RFC1123 format (DD-MON-YYYY)for the request
def today = new Date();
def UTCstring = DateGroovyMethods.format(dateTime, 'dd-MMM-yyyy')
testRunner.testCase.testSuite.project.setPropertyValue("RFC1123time", UTCstring.toString())
// Grab the request url - not too sure about this one. for this to work something is already defined as 'request' and 'url' but I dont know if thats postman or not...???
def url = request.url.trim();
log.info("request url = " + url);
// strip the url of the hostname up and leading slash
def strippedurl = url.replace(new RegExp('^https?://[^/]+/'),'/');
log.info("stripped Url = " + strippedurl);
anyway - we need to collaborate if we're going to get this sorted - so hit me back with your script progress and please remember - I'm not a scripter - I just steal all Rao's an Himanshu's good ideas!
nice one
rich
the trouble is the other one isn't actually a collection - its just environmetn config - so ReadyAPI! isn't actually recognising it as a collection I'm guessing.
I'm not very good with Postman - I'll have to have a look and see how it works - but to suffice it to say - it might be easier for you to just edit the project I gave you and add in the environment config. The problem is I can't play with the thing (make submissions) and go through the standard trial and error thing myself to see how it works and what it's doing.
ta
rich
Subject | Author | Latest Post |
---|---|---|