0
votes

I am very new to Jmeter and learning step by step.

Tried to create simple HTTP request in Jmeter and on Protocol tab- i have given "google.com".

while i run this, getting error as mentioned below:

Response code : Non HTTP response code : java.net.Malformed URL Exception

Response Message : Non HTTP response message: unknown protocol:google.com

Please help me to overcome this error and pass the test successfully.

Best Regards, Govindarajan G

2

2 Answers

0
votes

You can enter full URL as http://www.google.com to HTTP Request's Path field:

As a special case, if the path starts with "http://" or "https://" then this is used as the full URL.

Or enter domain name www.google.com in Server Name field:

Server Domain name or IP address of the web server, e.g. www.example.com. [Do not include the http:// prefix.]

Protocol is used mainly to indicate if using HTTPS or HTTP

Protocol HTTP, HTTPS or FILE. Default: HTTP

Notice if you want to reuse domain for several requests you can use HTTP Request Defaults

add a single HTTP Request Defaults element with the "Server Name or IP" field filled in. Then, when you add the 25 HTTP Request controllers, leave the "Server Name or IP" field empty. The controllers will inherit this field value from the HTTP Request Defaults element.

0
votes

You need to put your application under test host into "Server Name or IP" field of the HTTP Request sampler:

JMeter HTTP Request Domain

Request and response can be visualized using View Results Tree listener.


Also be aware that you can quickly get started with JMeter by recording your test actions performed in browser.

  1. Configure JMeter for recording. The easiest way is using JMeter Templates Feature

    • From JMeter main menu choose File -> Templates -> Recording and click "Create"
    • Open HTTP(S) Test Script Recorder and click "Start"
  2. Prepare browser for recording. Configure it to use localhost:8888 as the proxy server

  3. Open your application under test in browser and perform an action - JMeter will record the requests under Thread Group -> Recording Controller

More information: Apache JMeter proxy Step-by-step