2

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.

Image 1

Image 2

1 Answer 1

3

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:

  1. Add the next line to the hosts file (normally lives under C:\Windows\System32\drivers\etc\hosts)

    127.0.0.1   ss12345.localhost
    
  2. 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:

    enter image description here


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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. It worked. But I would also Like to know that, as I have different userSpecificSubDomain for different login users . So in that case can I specify this dynamically in DNS Cache Manager in someway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.