简体   繁体   中英

jmeter run same HTTP Request on multiple servers

I am trying to have jmeter run the same exact tests (same threads, assertions, etc.) on multiple servers, is it possible to do this without defining seperate HTTP Request objects for each one? I have tried setting up multiple HTTP Config elements but this does not work.

Thank you

Easiest and functional way is to set CSV file with list of hosts you want to run the tests on, then use CSV Data Set Config (Add -> Config Element) to load this file and set a variable name to something like hostname or whatever. Then add HTTP Request Defaults element and set 'Servername or IP' to that ${hostname} and you pretty much set-up. Now you just need to set Thread Group's 'Number of Threads' to the number of hosts you are trying to check so it will add a different variable from the file to each thread.

The only thing you have to remember is to put your CSV Data Set Config before the requests, at the beginning of the thread or (if you want to use it with larger name of threads) before the Thread Groups. And of course to change the number of threads to run it for each host/IP.

I've tested it a minute ago and it works for sure.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM