Forum Discussion
I need one of them converted to groovy so that it can work with soap ui
If you have an azure instance to test against you can try it with your variables for 1 request
Azure is just the clour hosting platform. I have a number of different projects hosting various different applications, but none of them are expecting me to publish your request to them.
Im also gonna need the previous questions i asked answered so i know what im trying and can tailor the request accordingly!
Ta
Rich
- ameesh19844 years agoContributor
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 - ameesh19844 years agoContributorAny update on this did u get to try
I am not a js guy hence struggling to find the statements to convert it to groovy - richie4 years agoCommunity HeroSorry ameesh1984,
I had a bit of a family emergency so didnt getround to it. I'll do it later tonight.
Apologies for the delay,
Rich - richie4 years agoCommunity Hero
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
- ameesh19844 years agoContributorWell your way faster than me
If you did not import the other json how will this work , both need to be imported and then one XML for soap ui exported out - richie4 years agoCommunity Hero
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
- ameesh19844 years agoContributorFirst I dont have ready api , so it took me a while to import it manually with all parameters
When you import you should select both files and import then it will work I think - ameesh19844 years agoContributor
Also i dont see your setup script in the soapui project did you put it there ?
- ameesh19844 years agoContributor
Where are the env variables i dont see them you have create those at TC, or project level
- ameesh19844 years agoContributorI am unable to run your project getting the http slashes error and I am unable to fix
If you can complete and send me one of them not full collection I would be able to understand I dont think I can complete that script with that logic myself
Related Content
- 4 years agoTommyTester
- 10 months agoMussieG
- 3 years agoMis3
- 5 years agodinojadhav
Recent Discussions
- 7 hours agoruchisingh