Reputation: 1
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
Upvotes: 0
Views: 1462
Reputation: 1
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.
Upvotes: 0
Reputation: 6398
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)
CSV file containing values to parameterize and 10_digit_value is column name to refer.
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.
Upvotes: 2