0
votes

When I tried to navigate to Parameters tab ( to parameterize part of request url) , for a http request with body data, I am not able to do it. I get the following error " you cannot switch because your data cannot be converted to target tab data. Empty data to switch" I cannot empty the the body as the its required for the post data ?

FYI. the parameterization task is simple, part of url needs to be filled with some random 10 digit number

appreciate the pointers. I am using Jmeter 3.0 SEE Screen shot here

2

2 Answers

2
votes

you no need to switch to parameters tab. you can parameterize the part (random 10 digit number) by replacing it with ${10_digit_value} (here, 10_digit_value is picked from CSV Date Set Config under variable names field. refer images)

enter image description here

CSV file containing values to parameterize and 10_digit_value is column name to refer.

enter image description here

replace the random 10 digit number with the reference.

You can follow the same approach in case the random number is in Path filed also.

0
votes

I could solve this by adding a bean shell pre processor that the HTTP request is retained and the URL is parameterized as well. This is the command i used in HTTP request URL the request was a POST request and had some payload in json { tags: .... } } /some/url/path//aggregate?snapshotId=${tim}

In bean shell pre processor I had added the following

import java.lang.System;
String timStr = System.currentTimeMillis().toString();
vars.put("tim", timStr );

This replace part of url with dynamic value and retained my Json in post request as well.