1

I tried stress testing with JMeter software to test a web site as it crashed after a sms campaign. Currently site has been moved to a physical server.

I tested multiple times by adding threads, it worked and gave few errors (for above 1000 threads), and worked for 400 threads with no error. So I tried distributed testing with 4 PCs including my one.

After I tried again with only my PC to send requests to the site by adding 400 threads(ramp up = 1 , loop = 1). But each and every requests gives error. Then I tried using 1 thread. Same error was given.

enter image description here

I checked my network connection, and there is no problem. Then I browsed the web site "http://www.myjobs.lk/", and it works fine.

These are the values I have given in testing.

enter image description here

enter image description here

enter image description here

Under this condition, I cannot perform the testing because it always gives errors. How can I overcome this problem?

6
  • i don't know why error is occurung in your case but in my case this error occurs everytime when my internet connection does not work. Make sure your internet should be working fine. Commented Mar 28, 2016 at 5:52
  • Internet connection is fine and Can access the web site, no problem of it Commented Mar 28, 2016 at 5:57
  • @TharinduKandegedara Can you check and show the values you are using for Server Name or IP and Path fields in HttpRequest or HttpRequestDefaults screen Commented Mar 28, 2016 at 6:35
  • You could try to switch the sampler implementation to Java or HTTPClient4 or look at this Click me Commented Mar 28, 2016 at 7:25
  • You don't need to post four screenshots to describe an UnknownHostExceptuon. Let me explain. It means that the hostname you tried to connect to is unknown. To the DNS. It's wrong. Fix it, or fix your DNS. Commented Mar 28, 2016 at 8:40

3 Answers 3

5

You're using incorrect JMeter configuration, change it as follows:

  1. Remove http:// from "Server Name or IP" input
  2. Put http to "Protocol input

    HTTP Request Defaults

    It is also possible to have the full URL in "Path" field like

    Path in HTTP Request Defaults

    But using "http://" in "Server Name or IP" won't work.

Also once you defined hostname, port, path, etc. in HTTP Request Defaults it will be automatically applied to all HTTP Request Samplers. You will be able to override an option for particular this or that sampler but if you don't - default value will be used. See Why It's SO Important To Use JMeter's HTTP Request Defaults for more detailed explanation and some use cases.

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

1 Comment

I think this is the solution for the IllegalArgumentException caused by putting in a "http://" in the server name or IP from my answer, not the UnknownHostException which was the original question? Or am I wrong?
2

For me it was helpful to setup proxy server: Http Request Defaults-> Advanced

Comments

0

Looks like JMeter tries to connect to myjobs.lk, and you browse to www.myjobs.lk. Try changing so that JMeter also connects to www.myjobs.lk

2 Comments

I tried it @gustf , but after that it give another error. I was unable find the problem. I mentioend it in my question.
I think you now changed it to include "http://", which is not the server name or IP (look at the answer from @Dmitri). I updated my answer with no "http://" to minimize confusion.

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.