Search code examples
jmeterproxy

JMeter dynamic proxy port


I need to run test of proxy service. The scenario is:

  • create proxy, sending request to service like POST http://localhost:8801/proxies
  • result is for example: {"port": 20251, "uuid": "6d384bfb-d94f-498c-a56a-7aef9dfeb545", "password": "rdtpUTRlGXSXdj2yy5qFStmrSLI"}
  • after using JSON Extractor I want to use port and password to create next request to test server.

How can I use port and password (username is constant) to define proxy parameters to create next request? Password and port are dynamically created by service.

I know, I can use Proxy-Authorization: header (don't know yet how to change user:pass to header value), but really don't know where and how set dynamically proxy port.


Solution

  • It's possible to specify proxy details under "Advanced" tab of the HTTP Request sampler:

    enter image description here

    If you're asking about how to extract port and password it can be easily done with JSON Extractor:

    enter image description here