ContributionsMost RecentMost LikesSolutionsRe: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" I was able to move ahead by adding the below event MockRunListener.beforeRoute and added the below script, the routing is working as expected. method.setURI(URI.create(method.getURI().toString() + "&enviornment=ENV1")) Thanks Temil for providing the solution Re: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" Sure I will update on this thread once I have the solution Re: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" Thank you for your resoponse. I changed the option to "Route To" and set the value to property expansion as ${#MockService#route_endpoint}. However, I am getting 404. Even I tried to just put the value as the complete URL, however, I am seeing 404. And also the script is not getting invoked when I have set the option as "Conditional" if (! mockRequest.path.contains('/oauth2')) return false // do not route the request mockRequest.queryString += '&env=ENV1' mockRunner.getMockContext().mockService.setPropertyValue("route_endpoint","https:/HOSTNAME/oauth2?mockRequest.queryString") log.info 'DEBUG: Modified query string - ' + mockRequest.queryString return true // route the request Re: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" Hi Alex, I tried to execute the same request from ReadyAPI and I see the same behavior as I was seeing from POSTMAN. The additional parameter is not getting appended while routing the request to LIVE system. Even the transcationlog only shows the parameters which I am passing intially. The additional parameter is not getting appended. Once again thank you for looking into it. Re: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" Hi Alex, Thank you for your response. I have tried the options which you have suggested however, its not working as expected. There are no error logs getting generated as well. Thanks, Vibhash Re: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" Hi Alex, Thanks for your response. I tried the solution provided by you. However I see that the addtional paratmeter is not getting added. Even in the script log the logs is not getting generated. Looks like it is not invoking the script. Please see the attached screenshot. Below is the HTTP log. Mon Nov 25 10:12:26 CST 2019: DEBUG: http-outgoing >> POST /as/oauth2 HTTP/1.1 Authorization: Basic dnhsVjVWbXpXeEhWWlRW Accept: */* Cache-Control: no-cache User-Agent: PostmanRuntime/7.20.1 Connection: keep-alive Postman-Token: 2672d906-2c71-4f45-bfeb-3533e526deed Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded Content-Length: 76 Host: HOSTNAME Cookie: PF=vczZKrzF0BnzGeLv7Wbgax scope=full&grant_type=password&username=ABCD&password=Test123 Mon Nov 25 10:12:26 CST 2019: DEBUG: http-incoming << HTTP/1.1 200 OK Date: Mon, 25 Nov 2019 16:12:26 GMT X-Frame-Options: SAMEORIGIN Referrer-Policy: origin Cache-Control: no-cache, no-store Pragma: no-cache Expires: Thu, 01 Jan 1970 00:00:00 GMT Content-Type: application/json;charset=utf-8 Transfer-Encoding: chunked 57 DEFAULT RESPONSE 0 Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" We are facing issue with the routing scenario of the ServiceV option “Route Non Virtualized Request”. As per our requirement once the virtual service receives the request, we have to add an additional query parameter and then route live system. However, we are seeing the query parameters are getting repeated. Below is the example: Request sent to virtual service: POST http://localhost:8090/oauth2?username=ABCD&password=Test123 As per the requirement we have to add this additional parameter: env=ENV1 to query string Therefore while routing the ServiceV should do the routing as http://LIVE HOST:PORT/oauth2?username=ABCD&password=Test123&env=ENV1 However, we are seeing double query parameters being sent. SolvedRe: Adding additiona query parameters to the request via ServiceV option “Route Non Virtualized Request" Thanks for response and sorry for the confusion We are trying to add the add the additional parameter as env=ENV1 The incoming request from the client looks like : http://localhost:8090/oauth2?username=ABCD&password=Test123 The requirement is to add addtional parameter env=ENV1 to the incoming request like : http://localhost:8090/oauth2?username=ABCD&password=Test123&env=ENV1 I tried to add the below script to the Events (however it did not work) and then later I tried to add the same script to the "OnRequest Script" where we are trying to extract the query parameters and then passed query property to the "Route to" option as : https://HOSTNAME?${query}&env=ENV1 Please see the screen-shot.However, it did not work. def incomingRequest = mockRequest.httpRequest def path = mockRequest.path def query = mockRequest.queryString context.setProperty("query", query) Below is the error what I see in the http logs : POST /?scope=full&grant_type=password&username=ABCD&password=Test123&env=ENV1/as/token.oauth2?scope=full&grant_type=password&username=ABCD&password=Test123 HTTP/1.1 I am new to the ReadyAPI ServiceV. If you think this can be achieved by a different method please help with it.