Contributions
Re: setting and retrieving variables within each thread
I believe you can do this with a "Properties" step. Set one up called "Properties" At the start of your script: def properties = testRunner.testCase.getTestStepByName("Properties"); long startTime = properties .getPropertyValue( "startTime" ); .... code properties.setPropertyValue("startTime", starTime.toString()); If you leave the actual property blank, it will come up as null the first time around. Hope that helps!615Views0likes0CommentsRe: getNodeValue is not passing the value from XPath to variable
I'm not sure what messageExchange.requestContent is. You need to replace with the actual name of your soap request. I know by default when you make the test step, it's called "Test Request". So it's quite literally the name of your Request test step. I couldn't put in, because I didn't know what it was1.8KViews0likes0CommentsRe: getNodeValue is not passing the value from XPath to variable
So I'd write something like this: groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); holder = groovyUtils.getXmlHolder(" #Response"); holder.namespaces["ns2"] = "http://www.cc.ddd/schema/PersonService"; def responseId = holder.getNodeValue("//ns2:id"); log.info (responseId); This is very similar to what I have running over here and it works a treat.1.8KViews0likes0CommentsRe: newbie question - apologies if it is obvious!!!!
Hey Jim, SQL queries in Groovy are quite easy! There's a fair bit of documentation on it floating around. A brief tutorial can be found here: http://docs.codehaus.org/display/GROOVY/Tutorial+6+-+Groovy+SQL I'm assuming you'd be checking the database for values based on what you use in your actual SOAP request, so to compare, you just need to pass your variables in to the groovy script, do your select statement and compare I tend to do data driven tests by using CSV files at present, but that's only because it suits what I'm testing. I do know you can get data from an MS Excel workbook by using the JXL library (http://jexcelapi.sourceforge.net/). So get your various data from various sheets in your workbook, then pass them to your various requests and other groovy scripts. Hope this is a good starting point. Feel free to ask specifics and I'll see if I can help Hopefully that's enough to get you started.15 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.2KViews0likes0CommentsRe: Things we love about SoapUI
I love the groovy scripts. I feel as though they give me the freedom to do nearly anything I need to. It makes dealing with any webservice very easy and flexible! I love load tests. They make my life very easy I like being able to quickly make a sample request for a webservice, and update it on the following releases. If I just need to make simple requests, I can do it without needing to build a test suite. I've seriously become a major advocate for soapUI. My current job is my first exposure to an SOA based system, and soap has become an invaluable test artifact.15 years agoPlace ReadyAPI QuestionsReadyAPI Questions745Views0likes0CommentsRe: reset request to 'default' after property transfer
In my soap requests, I refer to a Properties step rather that using a property transfer (still not 100% what they do ). Then I use groovy scripts to change these properties when I need. If I had a Properties step call "Properties" with the property "ID" inside it, I'd refer to it in a test request like so: <someelement>${Propreties#ID}</someelement> Then you can have a groovy script on either side of the request that manipulates the value of "ID" whenever you like. def properties = testRunner.testCase.getTestStepByName("Properties"); properties.setPropertyValue("ID", "7"); So you could have a groovy script underneath your test request that sets the properties back to whatever your defaults are. Hope that helps!1.4KViews0likes0CommentsRe: "Unique" ids for load test threads?
I think I've answered my own question. I didn't google hard enough def threadIndex = context.ThreadIndex; This will set threadIndex to be the index number of the thread. Example groovy script: def threadIndex = context.ThreadIndex; System.out.println("Hi, I'm thread "+threadIndex); If you run that as a load test with 5 threads, your output will look something like this: Hi, I'm thread 2 Hi, I'm thread 0 Hi, I'm thread 1 Hi, I'm thread 4 Hi, I'm thread 3 Hi, I'm thread 0 Hi, I'm thread 1 Hi, I'm thread 2 Hi, I'm thread 4 Hi, I'm thread 3 Now, where can I find the different values I can get from context??3.4KViews0likes0Comments"Unique" ids for load test threads?
Hi, I have a requirement to run a load test on a webservice, with the catch being that each thread needs to refer to a different variable each run. I can provide a list of values I need and write a script to process that, but when doing it as a load test, all threads will process the same file. Is there any way I can split is this out so I can ensure each thread is dealing with different values? I thought I could add some degree of logic if each thread could somehow be given a unique id or something similar. Any thoughts/ideas?4.2KViews0likes2CommentsRe: getNodeValue is not passing the value from XPath to variable
Are you still having this problem?? I had a similar issue and was able to fix it by specifying the namespace via holder.namespaces... It's a bit hard to help you debug without seeing your response. Can you send your response with the proper namespaces still in the XML (the one in your original post doesn't match your code), and I'll have a crack at helping you? S.9.1KViews0likes0Comments