1

There is a case to handle Square Brackets [] in Jmeter Request Ex : /api/v1/user/userlist/user[id]/7203/user[roles]/coe

How to handle this

2 Answers2

0

I don't think you can have characters like [ and ] in URL Path, see Characters allowed in a URL question for comprehensive information

You need to encode:

  • [ - to %5B
  • ] - to %5D

If your URL path comes from external source you can do this automatically using JSR223 PreProcessor and the following Groovy code:

sampler.setPath(sampler.getPath().replaceAll('\\[','%5B').replaceAll('\\]','%5D'))

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0

Change the implementation type to Java in the HTTP Request Sampler

working fine.... enter image description here