jmeter agents running specific tests - jmeter

I want to run a Jmeter test using multiple agents but I don't want each agent to run the same test.
How can I assign specific tests (thread groups) to a specific agent?
Thanks

Actually all JMeter remote slaves execute the same test plan so all the slaves should be doing the same stuff.
However you can change this behaviour by a trick with the help of the IF Controller and __machineName() or __machineIP() function like:
"${__machineIP()}" == "your_remote_slave_IP_address"
Demo:
As you can see, "Sampler 2" it not executed as IP address of the machine doesn't match the one, specified in the IF Controller

Related

Performance Test - Distributed mode with jtl and smtp listener

My test consists of tear down thread that sends the JTL report in the email through SMTP listener. This works fine when I run the tests in non distributed model as the JTL file is in one machine.
The issue I am facing is when I run these tests in distributed mode ( for some heavy loads). SMTP listener fails as the file is not found in the slave where the tests are running since JTL file is in the master. is there anyway I can make this work within the JMeter tests or do I need to create a separate script once the test is done to send the final report through email.
The easiest option would be indeed creating a separate test script for sending the results.
Alternative option would be
kicking off another JMeter Slave instance at the same host with the master
Limiting the SMTP Sampler to be executed only on that host via If Controller and __machineName() or __machineIP() functions combination like this:
This way you will be able to run SMTP Sampler only on the machine where the .jtl file lives.

Is it possible to run parallel tests with Browserstack local?

Im using a test setup with BrowserMobProxy. I'm running my test on Browserstack so I have to start Browserstack local otherwise I can't use BrowserMobProxy.
The next step is to run my tests in parallel but is this possible because I'm using Browsertack local? I can't find a solution.
Yes, it is possible to run parallel tests with Browserstack local. You can run upto 100 parallel tests with only one instance Browserstack local without having any performance impact.
Incase, you want to scale even more, you can start another instance of Browserstack local with the flag : --local-identifier <unique_string> and pass the following capability browserstack.localIdentifier : <unique_string> in your test. This would ensure the traffic of that test would route through this binary instance with the local identifier. You can run multiple such instances by passing some unique strings.

Setting up different number of users in JMeter master slave

In my JMeter master-slave setup, I want to setup a different number of users in each slave for the same thread group.Is it possible to setup with properties file? Is there any other way?
In Load Runner we can configure this easily with Load Generators. How to do in JMeter?
I would recommend doing it as follows:
In your Test Script define number of users using __P() function like ${__P(users,)}
In user.properties file on each slave machine specify the desired number of users like:
users=50
You can also pass the value via -J argument like:
jmeter -Jusers=100 ...
References:
How to do remote testing the 'proper way'?
Apache JMeter Properties Customization Guide

How to run Jmeter remotely on multiple slaves to stress multiple servers

I have a requirement wherein I need to run different jmeter testplans on different target servers. I went through this PDF here, but it does not meet my requirements. It explains how to stress a "single" webserver from different slaves using single jmeter master. But my requirement is to stress different servers from different slaves using single jmeter master. One way I could find is like below
Open multiple jmeter GUI instances on the jmeter master.
Create different testplans in each jmeter instance (basically these testplans differ only in terms of target server and login information)
Go to Run -> Remote Start -> Choose different slave in each instance
But I don't like this myself. Is there any better way to achieve this..?
Not sure that it`s a best way, some workaround:
Start the jmeter servers with some parameter :
SERVER_PORT=44444 ./jmeter-server -Jparam=1 &
SERVER_PORT=44445 ./jmeter-server -Jparam=2 &
SERVER_PORT=44446 ./jmeter-server -Jparam=3 &
Add this parameter in your testplan (in user defined variables):
And in testplan add a thread group and inside of this thread group a several If controllers with conditions like a ${__javaScript(${param}==1)}. Inside these If controllers put your different testplans:
Theriotically, they will start to work with different "branches". Also you can change the number of users depends of this parameter by using Beanshell and to use different pools for user names/password using CSV controller. ( /home/pools/${param}/pool.csv)

Is it possible to reuse created jmeter test plan for another test environment?

I have recorded a jmeter script for wiki page. That record was done in one of our test environment. That script is working fine and now i want to perform same load test for another test environment(Both environments are same, only urls are different).Is it possible to reuse?How can i do it?
I have added HTTP Request default element at the begging of test plan creation. Now recorded script consist of many HTTP Request element. Each request element contains Server IP of test instance.
Extract IPs and other env-specific data to .properties file:
http://jmeter.apache.org/usermanual/get-started.html#options
Read them in your JMeter with JMeter built-in function ${__P(someName)} as you see fit
Run your generic JMeter test with env-specific config data in .properties file
Yes. It is possible to run the same test in multiple environments. It all depends on how you design your test plan.
This site has exact details you are looking for.
http://www.testautomationguru.com/jmeter-manage-test-plan/

Resources