I am new to Jmeter and I am now facing with an issue when post a request with Json body with Jmeter. My request has body as below:
{"id":"KpiFormData","entity":"[\n\t\"{\\\"Timeout\\\": \\\"10\\\",\\\"kpiType\\\": \\\"Marketing.KPI.Common, Marketing.KPI, Version=x.x.x.0, Culture=neutral, PublicKeyToken=3fafga352gts345\\\",\\\"widgetID\\\": \\\"KpiWidget_0\\\",\\\"Weight\\\": \\\"Medium\\\",\\\"CurrentContent\\\": \\\"${pageId}_${version}\\\"}\",\n\t\"{}\"\n]"}
I want to parameterize this request to chain it with my test plan, so I need to input parameter ${pageId}_${version}
in this request. But when include these parameters, request is changed its format as below, it leads to 500 internal error when sending this request.
POST data:
{"id":"KpiFormData","entity":"[\n\t\"{\\"Timeout\\": \\"10\\",\\"kpiType\\": \\"Marketing.KPI.Common, Marketing.KPI, Version=x.x.x.0, Culture=neutral, PublicKeyToken=3fafga352gts345\\",\\"widgetID\\": \\"KpiWidget_0\\",\\"Weight\\": \\"Medium\\",\\"CurrentContent\\": \\"193_273\\"}\",\n\t\"{}\"\n]"}
Please notice that original request contains \\\
but request included parameters now contains \\
, this makes error.
If I only put numbers instead of parameters, this error does not happen, and post request works successfully.
I tried to change Json body by include extra \
, but it doesn't work,
Is there any suggestion or solution for this?