Search code examples
performancejmeter

JMeter sample response displaying in red with a warning in the View Results Tree table, error is: org.apache.http.conn.HttpHostConnectException?


I'm seeking assistance as I am new to JMeter. While creating my inaugural test case, I encountered a warning in the View Results Table highlighted in red, specifically pointing to the issue

identified as Thread Name:Thread1 1-1 Sample Start:2024-01-15 09:58:34 PKT Load time:1070 Connect Time:1070 Latency:0 Size in bytes:2624 Sent bytes:0 Headers size in bytes:0 Body size in bytes:2624 Sample Count:1 Error Count:1 Data type ("text"|"bin"|""):text Response code:Non HTTP response code: org.apache.http.conn.HttpHostConnectException Response message:Non HTTP response message: Connect to www.w3schools.com:80 [www.w3schools.com/192.229.133.221] failed: Connection refused: connect HTTPSampleResult fields: ContentType: DataEncoding: null

Despite having a stable network connection, I attempted to execute the test on different machines. Additionally, I have set the Java path and explored various approaches to address the error, but unfortunately, I have been unable to resolve it. Any guidance or insights to help overcome this issue would be greatly appreciated.


Solution

  • It's not a warning, it's an error and it means that JMeter cannot establish connection to server www.w3schools.com at port 80

    The website is normally available and I cannot reproduce your issue:

    enter image description here

    So my expectation is that either there is a problem with your network (i.e. the website is blocked by your ISP) or you're behind a proxy server. In the latter case you need to make JMeter aware of this proxy server by