Contributions
Re: How to add or set query params in rest test step using groovy script
Answering my own question. I have used below code to set query params to REST request. String targetQueryString = ""; if (mockRequest.getHttpRequest().getQueryString() != null) { targetQueryString = mockRequest.getHttpRequest().getQueryString(); } Project project = new WsdlProject(); RestServiceConfig serviceConfig = RestServiceConfig.Factory.newInstance(); RestService service = new RestService((WsdlProject) project, serviceConfig); RestResourceConfig resourceConfig = RestResourceConfig.Factory.newInstance(); RestResource resource = new RestResource(service, resourceConfig); RestMethodConfig methodConfig = RestMethodConfig.Factory.newInstance(); RestMethod restMethod = new RestMethod(resource, methodConfig); RestRequestConfig requestConfig = RestRequestConfig.Factory.newInstance(); RestRequest restRequest = new RestRequest(restMethod, requestConfig, false); if (targetQueryString.length() > 0) { for (String param : targetQueryString.split("&")) { restMethod.setPropertyValue(param.split("=")[0], param.split("=")[1]); } }1.7KViews0likes0CommentsRe: MockService Response increasing with continuous load
Answering my own Question. After further analysis, I found that the reason for increased response times in memory leak and this memory leak is happening because of soapui dynamic property expansion. Instead of using soapui dynamic property expansion, I have used a Groovy template engine to replace the variables with values. This has resolved the problem.590Views0likes0CommentsMockService Response increasing with continuous load
Hi All, We have created a mock service framework using SoapUI. Wehave written a custom Groovy class where response XMLis getting created and the same responseXMLis being set as a mock response using context expansion in mock servicescript. We deployed the soapuiproject as war in tomcat and we are running the load test using these mocks. Mock response times are getting increases when load increased. I am not logging any comments. Is this the expected behavior with SoapUI mock services when running load tests? Can someone please help mein resolving this response time increase issue?642Views0likes1CommentHow to add or set query params in rest test step using groovy script
Hi, I am trying to create a template test step to run different Rest requests by updating path, endpoint, resource, headers and query params using the Groovy script. I am able to set all required fields except query params. Can someone please help me how to set/add query params to Rest Test Step using groovy?1.8KViews0likes1CommentIs it possible to use if else conditions in dynamic property expansion
Hi, I am trying to send a dynamic mock response using dynamic property expansion. I am able to use a ternary operator to set dynamic value. But I want to see if else conditions can be used or not? Below is my sample code which I am trying. Code working with the ternary operator ${=(result.equals("success")?"success":"error")} Code not working with an if-else condition: ${=if(result.equals("success")){"success"}else{"error"}}Solved1.8KViews0likes2Comments