Contributions
Re: How do I control which steps are executed in SOAP UI
You're right, it doesn't work I think this is because the function Math.random() returns a random number between 0 and just under 1. You've then got this as an integer, so it's always returning zero - hence the first branch (1 horse) is always being taken. If you make the change to the line intRandNum = Math.random() so that it's intRandNum = Math.random()*100 then this will, fairly obviously, multiply the generated value by 100, and give you a number between 0 and 99. One other small change I think you'll need to make is replace the occassions where you have "intRandNumHorses" with "intRandNum". This should then, hopefully, give you the results you're looking for. Cheers, Geoff404Views0likes0CommentsRe: Get the response and request number of bytes
If the number of bytes in the Response is contained within the Header then the Groovy script: def value = testRunner.testCase.testSteps["Request"].testRequest.response.responseHeaders["Content-Length"] should get you the number of bytes received for the Response.568Views0likes0CommentsRe: Transferring Header Content - Is there a way?
Are you talking about reusing the Header content in from the Request or from the Response? I'm guessing you're looking for it from the Response - if so a simple groovy script should do this for you. For example: def headerValue = testRunner.testCase.testSteps["Request"].testRequest.response.responseHeaders["Server"] This will read a value from the header, in this case the Server. This can then be stored into a Property and reused in any way that you require. Hope that helps, Geoff560Views0likes0CommentsRe: using Load Test
Hiya, What you need is in the sentence preceeding the one that you have quoted. To better understand the difference between these two let's create a small example; a TestCase with two groovy scripts, the first sleeping for 900ms, the second for 100ms. We'll run this with 10 threads for 10 seconds, which theoretically should result in 100 executions of our TestCase; As you can see, the first script should take 900ms, the second 100ms, a total of 1000ms for each Test Case...that is 1 second for the Test Case. As each execution should take 1 second, then 10 seconds of 10 threads should, hopefully, result in 100 executions. Hope that helps. Geoff523Views0likes0CommentsRe: Get properties from HTTP Response
Do you need to use Groovy Script for this, or can you just use a "Property Transfer" Test Step? Looking at your post I should think that the inbuilt SOAP UI functionality should easily allow you to store the elements from your Response and from there you can reuse them in the next Request. Geoff553Views0likes0CommentsRe: What is support for SOAP UI PRO license ?
Yes, there is a SOAP UI Pro forum. You should, I believe, have been provided with a Username and Password when you purchased your SOAP UI Pro licence. Log into the forums with these details and you should be able to both see, and access, the Pro forums.520Views0likes0CommentsUnable to create new reports
Hi, When I attempt to add a new Subreport or Report I don't seem able to add them. For a Subreport I populate all the fields, but when I press the "OK" button, nothing happens at all. For a Report I populate the name, press "OK" and then am taken to select the subreports. However, not matter how many I select from the list, when I press "OK" I am then taken back to the first dialog box where I entered the name. This is on soapUI Pro 3.5.1 - Build date 2010/04/12 I'm sure I'm being a fool, and there's something simple I'm missing, but I can't get it to let me create a new report. If anyone's able to confirm my foolishness by pointing out where I'm going wrong, that would be appreciated. Cheers, Geoff14 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.8KViews0likes0CommentsRe: Re: How to create datetime string in soapui using groovy
In a groovy script you can use the following to get today's datetime: date = new Date() You can then modify this into the format you desire with something along the lines of: dateFormat = new java.text.SimpleDateFormat('yyyyMMdd-kkmmss') shortDate = dateFormat.format(date) You can then use this as required - passing it into a parameter or whatever else you need. Hope that helps. Geoff4.3KViews0likes0CommentsRe: data driven Test Case - saving requests / responses to an external folder
Hiya, How about a groovy script along the following lines: def name = context.expand( '${Properties#Filename}' ) def location = context.expand( '${Properties#Location}' ) def getResponseFilename(name) { date = new Date() dateFormat = new java.text.SimpleDateFormat('yyyyMMdd-kkmmss') shortDate = dateFormat.format(date) respFilename = shortDate + "-" + name + "-response.xml" } def getRequestFilename(name) { reqFilename = shortDate + "-" + name + "-request.xml" } def file = new PrintWriter (location + getResponseFilename(name)) def Response = testRunner.testCase.testSteps["Request"].testRequest.response.contentAsString file.println(Response) file.flush() file.close() def file2 = new PrintWriter (location + getRequestFilename(name)) def Request = context.expand( '${Request#Request#//soapenv:Envelope[1]}' ) file2.println(Request) file2.flush() file2.close() This allows you to determine the folder you want to save in a property, and the same for the root part of the filename (in your case 01_AK_001, 02_AL_001...) - you can read this into the appropriate property from elsewhere (or you could read it in directly here and bypass the Property completely if you want). It adds a datetime stamp so if you run the same request multiple times the requests and responses don't overwrite each other.2.6KViews0likes0CommentsRe: How to add different request templates in Soap UI for different testcases.
You could always have each of the three different requests as separate steps in your Test Cases and then use a Groovy Script to go to the appropriate one of the three requests based on a parameter testRunner.gotoStep(testRunner.testCase.getTestStepIndexByName('YourTestStep')1.3KViews0likes0Comments