Contributions
Re: Datasource in loadtest in soapui- help please
I've got a soapUI Runner running a Test Case with 3 steps, 1. File Datasource 2. GET Rest request 3. DataSource Loop My datasource has 16 records which are used as parameters for the REST request as a search field I'd like to run this Test Case repeatedly in a loop for a couple of hours, but only 16 VUs get to make a valid request when I pipe the output to the Table Log widget. I've tried playing with the Flow Loop widget but it just appears to multiply the requests sent to the soapUI Runner not restrict it to 16 VUs at a time. I might be piping them incorrectly I'm using LoadUI 2.5.1 thanks11 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.1KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
YES! that's it Erik, thank you so much I had manged to sort() the params value before I used them, but I haven't tested enough URIs to be sure it always comes out alphabetically. requestPath = context.getProperty( "requestUri" ) //log.info "requestPath is ${requestPath}" pathToSign = requestPath.URI.toString() params = context.getProperty("httpResponseProperties") //log.info "Params is ${params}" path = request.getPath(); //log.info "Path is ${path}" if ( path =~ '''}'''){ //log.info("Do Nothing") }else{ def queryString = "?" request.params.sort().each{ param -> if((queryString.length() != 1) && (param.value.value != '') ) queryString += "&${param.value.name}=${param.value.value}" //testString = "${param.value.value}" else if (param.value.value != ''){ queryString += "${param.value.name}=${param.value.value}" } } pathToSign += queryString }12 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
(this thread isn't resolved properly yet, but I can't find the edit Title link) the requestUri trick only works if you use a Templated variable URI >:( If you have parameter query type variables then I'm back to finding or defining the proper/consistant sort order for them before I calculate the signature for my REST request. It's not always alphabetic and I haven't found where it's stored (if anywhere)12 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
Finally found the answer! http://www.soapui.org/forum/viewtopic.php?t=7016 I just had to ask the right question def method = context.getProperty( "requestUri" ) // log the complete URI log.info( "this is it " + method.URI.toString() )12 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
After getting the Request EventHandler to work on most request I do I've come full circle now and need to know how to get the Full Path variable interpolated URL from within Groovy I'm guessing there's something under request but have no idea where to find it. I've started to do Data Driven tests from a JDBC connection and my Test case has 1. JDBC Data source 2. Template URL REST GET Method - /data/app/ws/rest/companies/entity/v1.0/{CompanyID} 3. Data source Loop In the REST Step I have put ${MySQL DataSource#CompanyID} as the CompanyID value and now my signature signing code is signing /data/app/ws/rest/companies/entity/v1.0/${MySQL DataSource#CompanyID} instead of /data/app/ws/rest/companies/entity/v1.0/10002 and I fail authentication with the service So I need to do parameter expansion from within Groovy, I guess by using the context some how?12 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.5KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
I'm back to the Sort order problem now I think the screen shot shows what I mean. It doesn't matter what order you put the parameters into on the Left hand side, the Right hand side always shows the same order, and the Right Hand side dictates the order of the parameters shown in the Full Path On the left hand side screen I can change the order of the Resource Params but not the Request Params that are inherited from the Resource, and the Sort order of the inherited Request Params is different to the Resource Params Should I raise this as a bug? Do you want a copy of my Project?12 years agoPlace ReadyAPI QuestionsReadyAPI Questions11KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
To access a project property in a RequestFilter event Handler, you do it like this accessKey = request.operation.interface.project.getPropertyValue("accessKey") log.info "my request key is ${accessKey}" I haven't figured out how to get a Global though accessKey = #Global#AccessKey accessKey = ${#Global#AccessKey} accessKey = ${AccessKey} log.info "my global key is ${=AccessKey}" these end up with Groovy syntax errors because of the # or =12 years agoPlace ReadyAPI QuestionsReadyAPI Questions11KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
Thanks Erik, I've got the Event Handler running the script when I make a request from a resource instead of just a TestStep now. I still need to sort or hardcode the URI parameters or maybe set it explicitly. Another question is how do I find the Project level properties from the request variable? from the TestStep I could do this secretKey = testStep.testCase.testSuite.project.getPropertyValue("secretKey") but I can't see how the request 'links' up to the Project it is in thanks12 years agoPlace ReadyAPI QuestionsReadyAPI Questions11KViews0likes0CommentsRe: Retrieving the completed REST URL in Groovy
Hi thanks for the reply It makes sense, but I think it's over my head (beyond my Java skills) There isn't a RequestFilter button on the TestSteps Editor screen I've found this http://www.soapui.org/apidocs/com/eviwa ... ilter.html But I don't know how to use it if I'm not calling it from a Groovy script? The problem with sorting the parameters is I don't know where the sort is stored or how to access that field, it could be within the generated WADL or when you view the parameters in the bottom left corner window and move them up and down or sort alphabetically. I'd like to have a function/method that doesn't need to know what the parameter names are before it can write them out, then I can reuse that function with all my tests on my Different Resources (who each have different parameter requirements). Or else I have to write a different function for each Resource test - not good for code reuse or fixing bugs etc From my Groovy script: Path is now /data/app/ws/rest/companies/role/search/v1.0?page=2&q=smith&type=DIR&size=3 From the Request Path is now /data/app/ws/rest/companies/role/search/v1.0?page=2&q=smith&size=3&type=DIR I haven't noticed but does the Request parameters always come out alphabetically? Is the Sort only used to show in the fields in the GUI like the Form for the Rest Test Request? thanks12 years agoPlace ReadyAPI QuestionsReadyAPI Questions11KViews0likes0Comments