Reputation: 1293
I am using jmeter to run some load tests and have it set up for distributed testing. I want to run the same test plan on each remote machine but want to somehow parameterize each run based on which remote server it is running. The test plan has a single thread-group which runs through an infinite loop of test samplers. The test samplers are all selenium based test cases and open browsers to load web pages. For example when I run the load test I want something like:
server 1: run threadgroup with 10 users using selenium + ghost webdriver
server 2: run threadgroup with 1 user using selenium + chrome webdriver
server 3: run threadgroup with 1 user using selenium + firefox webdriver
Upvotes: 1
Views: 520
Reputation: 1293
Oh this is a total hack and I dont like it but here is how I solved it.
1). Create 1 user defined variables (add->Config->User Defined Variables). Add the config for all hosts as a separate row like this:
2). In the thread group set the Number of Threads value as:
${__V(${__machineIP()}_numThreads)}
It will create 10 users if the test plan runs on 10.1.2.1, 1 user if it runs on 10.1.2.2, 2 users if it runs on 10.1.2.3. In this way I am able to parameterize each server and pass as many different variables to each server as I want just by updating the single user defined config element. You can use the __machineName() function instead of machineIP() if that is easier. In windows you can get the machine name by right clicking my computer and selecting properties - it is case sensitive.
Upvotes: 1
Reputation: 1733
Create a CSV file with same file name & same path on Server 1, Server 2 & Server 3.
Keep different values in Server1, Server 2 & Server 3.
So when you provide the file name & path in the Master Jmeter machine (Controller) e.g. C:\test.csv
the load generators (remote servers) will search for this file in their local path.
Hope this will help.
Upvotes: 0