Enock Prince
Enock Prince

Reputation: 141

Why Jmeter is not recording application url starting Localhost?

I have an application installed on my machine for learning purposes. Its URL is http://Localhost:8080/*****. JMeter fails to record the requests whenever I use the URL above. If I replace "localhost" with the machine IP, JMeter records without any issues. Loadrunner can record both URLs.

Is it a bug or is the JMeter proxy setting designed in that way?

Thanks...

Upvotes: 3

Views: 1491

Answers (2)

Latest version of Firefox by default does not allow localhost or 127.0.0.1 to be proxied.

After searching a lot online, finally the following steps worked for me:

  1. Enter about:config in the Firefox URL bar

  2. Search for config network.proxy.allow_hijacking_localhost using the search box and toggle its value to true

Now try recording scripts in Jmeter from localhost related webpages.

Note:

  1. I am using Firefox 80.0.1 (64-bit) and Apache JMeter 5.3
  2. I found reference from Setup JMeter proxy to record activities on a local web application

Please find the about:config page for Firefox browser below.

Upvotes: 2

Dmitri T
Dmitri T

Reputation: 168002

JMeter doesn't filter loopback URLs, however you browser can do this, at least latest Firefox does:

enter image description here

As per How to Run Performance Tests of Desktop Applications Using JMeter article you might also need to install Microsoft Loopback Adapter

enter image description here

And last, but not the least, the application, browser and JMeter might be looking into different protocols: IPv4 and IPv6, you need to ensure that your localhost hostname resolves into the same IP address for all 3 components.

Upvotes: 1

Related Questions