18

I'm new to jmeter.
I'm trying to test a web app using proxy server.
I have gone through the jmeter docs and got the settings but I'm currently working under company proxy.

So how can I set the proxy server for jmeter from behind the current proxy?

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
user2405453
  • 199
  • 1
  • 1
  • 3

2 Answers2

22

Read :

If you are testing from behind a firewall/proxy server, you may need to provide JMeter with the firewall/proxy server hostname and port number.

To do so, run the jmeter.bat/jmeter file from a command line with the following parameters: - '-H' [proxy server hostname or ip address] - '-P' [proxy server port] - '-N' [nonproxy hosts] (e.g. *.apache.org|localhost) - '-u' [username for proxy authentication - if required] - '-a' [password for proxy authentication - if required]

Example :

jmeter -H my.proxy.server -P 8000 -u username -a password -N localhost

Alternatively, you can use --proxyHost, --proxyPort, --username, and --password

If you're looking to learn jmeter correctly, this book will help you.

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
  • 2
    if the username contains "/" symbol and password contains "@" symbol, how to write the command line correctly? I tried using "/" and "@" directly or changing them to as "%5C" and "%40", but neither succeed. – elephant.lyh Jul 24 '17 at 04:53
  • For using password containing special characters, you need to do html encoding instead of url encoding. E.g. `&` need to be replaced by `` instead of `%26`. For all chracters, refer this wiki page. https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references – Manish Bansal Feb 06 '20 at 15:11
11

Change Port and Proxy on JMeter 5.0

UI Mode

  1. Create Thread Group --> HTTP Request
  2. Go to Advanced fill "Server Name or IP:" = 127.0.0.1 , "Port Number:" = 8888
  3. enter image description here

Non UI MODE

  1. Add to your command -H 127.0.0.1 for Proxy Host
  2. -P 8888 for Proxy port
  3. Example: C:\jmeter5.0\bin>jmeter -n -t C:\example.jmx -l C:\scriptresults.jtl -H 127.0.0.1 -P 8888
Ru8ik
  • 305
  • 4
  • 5