jmeter Cannot find interface error - jmeter

I'm trying to run an test on jmeter. However, when I'm run an test I'm getting the following result: Non HTTP response code: java.net.UnknownHostException/Non HTTP response message: Cannot find interface ec2----*.compute-1.amazonaws.com
Why would I get the following error message when I'm trying to do an load test? I'm running jmeter from the desktop and I'm trying to an load test from the site from the AWS.
Thank you,
Kevin Davis

I have found the resolution. It was an advance setting of the http request defaults that was causing the issue.

It looks like you are attempting to do IP spoofing using wrong settings, you should not be using your AWS instance hostname in the Source address tab, it should be rather network adapter name, you can get it using i.e. ifconfig command.
Once you determine network adapter name - substitute your ec2----*.compute-1.amazonaws.com with the real adapter name, i.e. eth0
If you are not going to use the IP Spoofing - just leave this Source address field blank.

Related

Mule4: "Remotely Closed" error for HTTPS POST

HTTPS POST requests are successful in POSTMAN both with and without Port 443. But failing in MULE Application with the error Remotely Closed.
Also, I tried to access the host using commands PING, TELNET and TRACENET for the host server via Command Prompt. Those fail with error Request Timed Out.
Can you please let me know where the issue lies?
Workaround:
For Mule4, remove the Global Element "HTTP Request Configuration" and pass the URL directly.
I am working with SAP Revsym Rest API's and this worked for me.
Plese, share config details. My guess is that config has path as well as path exist in the http request. These 2 pathes combined lead request to wrong place. That would be only possible explanation for provided information.

Not able to Initialise smartmeter as ite generate an error?

Error Screenshot I have recorded test scrip using smart meter.
But I when I tries to load the script "Rum smartmeter Test"
It gives following. I have no requirement of remote server as i wanted to run basic Testscript from local machine
*> Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused connect*
Just for the background please note that SmartMeter.io is based on Apache JMeter but adds new features such as one-click test reports, advanced scenario recorder, user friendly distributed mode, acceptance criteria and many others.
Looking forward for your suggestion.
Thanks.
Looks like SmartMeter is unable to start a load generator. The most common reason is that the required port 1099 is already occupied by some other program or the load generator can sometimes be blocked by your firewall. I suggest you restart your computer and try again. If it doesn't help, then you need to find out what is occupying that port. See for example How can you find out which process is listening on a port on Windows?
You should be able to get some information from logs/generator.log.
You can also run tests from SmartMeter Editor, the same way you would do in JMeter.

ip spoofing not working jmeter

I am trying IP spoofing in JMeter HTTP requests but my public IP is going to the request, not the IP address which I have specified under advanced option in HTTP sampler. can anyone help me in this?
I am also sharing the screenshot of my test plan.
here
In my test plan my let's say my IP is x.x.x.x and the IP which I have configured for IP spoofing is: 192.168.23.12 as shown in the screenshot but request to the server is still going with my IP which is x.x.x.x.
Can anyone help me out in this?
As per HTTP Request sampler documentation
Source address field [Only for HTTP Request with HTTPClient implementation]
So change "Implementation" to HttpClient4 and it should start working as expected.
Also be aware that you need to have this IP address (or alias) defined in the underlying operating system.
See Using IP Spoofing to Simulate Requests from Different IP Addresses with JMeter article for more information and configuration instructions for different operating systems.
Please check the below test plan:-

How to simulate "server down" situation using Burp suite proxy?

I tried using Burp suite to simulate the above for a particular domain. I am a beginner on this and don't know how to set it up. I couldn't find a built-in option for this.
Also, if there is no option, will I need to forward the request to some random IP address so that the connection gets timed out?
Update
Actually I doubt if redirecting to some invalid IP will give a connection timeout. Or will it give a timeout? I just want to know what response will I get if the server is down.
There isn't a feature to simulate "server down" but you can redirect as you suggest. If you redirect to an unused IP address (perhaps 192.168.99.99) you will normally get a timeout.
You can configure this in Proxy > Options > Proxy Listeners > Edit > Request Handling
You can just edit the response code to be a server error. You can do this automatically using match and replace as well.

How to make Jmeter recognize "localhost" URL?

How to do performance testing of localhost url which is accessible only to my computer?
I am able to do performance testing using jmeter for live websites like google etc but jmeter is not able to detect local url.
URL of application-192.168.121.20:8001
2. Output of View Results Tree listener- ALL failed http alerts Description of screenshot of HTTP Request sampler- added only server name i.e URL –
I have the same problem, but my mistake is that I thik the Server Name was the URL Base and it is not works.
This is the wrong way:
Server Name: "localhost/api/v1" (Wrong)
Http Request -> Path: "/auth"
Http Request Defaults (Jmeter):
The correct way:
Server Name: "localhost"
Http Request -> Path: "/api/v1/auth"
Http Request Defaults (Jmeter):
Http Request (Test):
JMeter doesn't care whether application under test is local or remote, if you cannot hit local URL with JMeter - something is wrong with your HTTP Request Sampler configuration, most likely "Port" value is wrong.
In order to be able to help we need to know the following:
1. URL of your application
2. Output of View Results Tree listener
3. Contents of JMeter log
4. Description of screenshot of your HTTP Request sampler
As an alternative option you can try recording your scenario using JMeter Chrome Extension and see if you're able to replay recorded scenario without errors. Again, use View Results Tree listener to inspect request and response details.
In general it is not recommended to run the application under test and the load generator on the same physical or virtual machine as the load generator (JMeter in your case) may consume immense amount of resources like CPU and RAM and it may interfere your application health (unless you're using completely isolated containers), so I would recommend use separate hosts for application and the load generator.
For anyone testing localhost with JMeter for the first time, make sure endpoint are configured correctly.
For a Get request of http://localhost:8080/rest/comments, set:
Server Name or IP: localhost
Port Number: 8080
Path: /rest/comments
Method: Get
please note that i have attached images for each step
Step 1 : First create Thread Group .After Create thread group you will see three part.
Number of thread means how many requests you want to perform and loop count means how many time you want to execute
Step 2 : right click on the thread group Add --> Sampler --> http request as like attach image .In the name filed just give a name as like whats you want.In my case it was Order Service http request
In protocol filed i am going to http request so for that i have given http in the box
In the server name i have set it to localhost because i am using local machine .If you use just remote server then use Ip address or domain name . Don't use http or port number before or after the ip address or domain name
In the port number field i am using 9003 that's why I have given 9003 .
In the http request field use your desired http method in my case i will post some data so i am using POST method so that i have selected post method
Path field just use the path after the ip address or domain name or localhost in my case it was order/create-order . please note that do not add forward slash before that. slash will automatically added by JMeter.
As it is post request so My server side request some body data so i have attached that as json format so click on the body data
step 3 : Sometimes you need to pass some header information for example content type . for that you need to create another option HTTP header manager to create that option . Right click on the thread group then add-> config element- > http header manage as like attach image . I have given the content type
Step 4 : Now you are ready to for request to server but sometimes you need to check the response and other thing so for that click on the thread group then add -> listner -> view result tree
Final Step : To execute the request, click on the greeen button from the top bar.
In order to have Jmeter "recognize" localhost (and any other program on your machine) you have to modify host file:
On Windows
Typically host is located under C:/windows/system32/drivers/etc/. Just open it with any text editor.
Add following record to this file and save changes:
127.0.0.1 localhost
On OSx
Open /private/etc/hosts file for editing with any text editor
Add following record to this file and save changes:
127.0.0.1 localhost
As a result you'll map localhost to your computers default local IP address which is 127.0.0.1
Get your ip addres using ipconfig (windows)
Think your URL is - http://192.168.8.149:3000/api/user/showTeams
Use Server Name or IP -192.168.8.149
Use Port Number - 3000
Use Protocol - http
Use Path - api/user/showTeams
Use IPv4 address instead of using localhost or 127.0.0.1 to access your local application.
Get JMeter's recording template from File > Template.
Set proxy on 8888 port and start recording
In my case, I was running a web app using local Tomcat on port 8080. JMeter was unable to connect using localhost:8080/app-name. It was connecting just fine to the remote-host:8080/app-name.
Solution: I found out that there was another application accessible using 127.0.0.1:8080/another-app. Perhaps, this was confusing JMeter. So, eventually, I changed my tomcat port to 9090 using server.xml and then JMeter was able to connect to localhost:9090/app-name
for your path use http://[::1]:{port}/route
[::1] instead of localhost fixed this for me, took me hours to figure that out

Resources