-
Find the static value in the Retrieve request body. You shall get it in the “arguments” node.
-
Select the value, right click and select “Replace with Parameter” -> “Create new parameter”.
-
Enter the parameter name.
In the example script below, the “customer_id” static value has been parameterized with the parameter <customerID>:
web_custom_request("RetrieveWithParm", "URL=http://192.168.178.125:5001/api/ServerApi/RetrieveWithParm", "Method=POST", "Resource=0", "RecContentType=application/json", "Referer=", "Snapshot=t144.inf", "Mode=HTTP", "EncType=application/json;charset=UTF-8", "Body={\"version\":\"1.0\",\"requestid\":\"50CA839C-E8DF-4303-A146-33EBB30BEB45\",\"appname\":\ "psapi4loadrunner\",\"namespace\":\"Psapi4loadrunner\",\"session\":\"""<gs_SessionID>\",\ "type\":1,\"transaction\":{\"transactionid\":\"""<gs_TransactionID>\"},\"content\":{\"retrieves\": [{\"retrieveid\":\"50CA839C-E8DF-4303-A146-33EBB30BEB45\",\"parent\":\"\",\"dataobject\": \"d_customer_pro\",\"""parentcolumn\":\"\",\"isreport\":false,\"isdynamic\":false,\"dwsyntax\":\"\", \"sql\":\"\",\"processing\":1,\"arguments\":[{\"category\":1,\"name\":\"customer_id\",\"""type\": \"number\",\"value\":<customerID>}]}]}}", LAST);