Search code examples
proxyjmeterjmeter-plugins

How to run Jmeter Scripts with proxy for few request & without proxy for other


I have a requirement to run the Jmeter test with few request requires proxy and other without proxy . For eg . Let's say I have the flow

  1. Launch URL
  2. Login
  3. Run the web service call to get some id
  4. Search
  5. Logout

here all the request uses proxy except request 3 .

When I tried to open the Jmeter with jmeter -H proxyserver -P port all the request is passing except request 3 which throws error

 Data type ("text"|"bin"|""): text
Response code: 407
Response message: Proxy Authentication Required

Response headers:
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: NTLM
Cache-Control: no-cache
Pragma: no-cache

Can anyone help me with this ?


Solution

  • You have "Proxy Server" section under "Advanced" tab of the HTTP Request sampler where you can set different proxy settings for individual samplers

    JMeter per/sampler proxy settings

    You can also control HTTP Request sampler settings globally using HTTP Request Defaults and override the settings if needed on sampler level