Search code examples
jmeterperformance-testingload-testingjmeter-5.0

"UnknownHostException" in Jmeter


I just started learning JMeter today. Wrote a simple web test - 10 user, 1 iteration to hit a webpage, but in the "view result tree" I get "JMeter Response code: Non HTTP response code: java.net.UnknownHostException"

Thanks in advance for helpersThread group


Solution

  • Most probably you're behind a corporate proxy, your computer is not connected directly to the Internet, it is connected via special machine which grants Internet access to other computers over the network.

    You need to make JMeter aware of this proxy, it can be specified at

    1. "Advanced" tab of the HTTP Request sampler (or even better HTTP Request Defaults)

      enter image description here

    2. Via command-line arguments like:

      jmeter -H your-proxy-host -P your-proxy-port
      
    3. Via system.properties file like:

      https.proxyHost=your-proxy-host
      https.proxyPort=your-proxy-port
      

    More information: Using JMeter behind a proxy