Reputation: 31
I am trying to do load testing using JMeter for the first time. I am trying to access URL : http://ss12345.localhost:9001/testManagement/login. The Sampler Result Printed as :
Thread Name:Thread Group 1-1
Sample Start:2020-04-02 18:25:52 IST
Load time:21
Connect Time:21
Latency:0
Size in bytes:2490
Sent bytes:0
Headers size in bytes:0
Body size in bytes:2490
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):text
Response code:Non HTTP response code: java.net.UnknownHostException
Response message:Non HTTP response message: ss12345.localhost
HTTPSampleResult fields:
ContentType:
DataEncoding: null
I do not understand why it is not picking the userSpecificSubDomain : ss12345
.
If I do not specify userSpecificSubDomain then it opens the Login Page otherwise it throws the Non HTTP response code: java.net.UnknownHostException.
For more details, refer to the below images.
Upvotes: 2
Views: 2998
Reputation: 168247
JMeter tries to resolve the IP address of the DNS hostname ss12345.localhost
and since it is not known it fails to determine the address therefore it fails.
If you have JMeter and the application under test on your local machine you can:
Add the next line to the hosts file (normally lives under C:\Windows\System32\drivers\etc\hosts
)
127.0.0.1 ss12345.localhost
Or alternatively (or if you don't have administrator permissions hence cannot edit the hosts file) you can add a DNS Cache Manager to your Test Plan and specify the mapping there:
Just in case be aware that having the application under test and the load generator running on the same machine is not the best idea as they will start struggling for resources so load test results will not be reliable as you won't be able to tell whether it is a performance bottleneck or it just a lack of i.e. RAM
Upvotes: 3