1

I have created a Thread Group which has Firefox Driver Config , a Web driver Sampler and a View Results Tree Listener. I have also added CSV Data set Config and passing username and Passwords through it to the application. I have around 10 Credentials.

The scenario i want to do is, I want all the 10 users to login at the same time i.e 10 instances of the firefox browser to be invoked and do the job.

Can anyone tell me, how can i achieve this in J meter?

1
  • so the load testing is not part of the gui front end. It sounds like what you want to do is load up users on the back side and then execute some front end testing at the same time with multiple browsers? Please clarify a little more...the tags only say jmeter but you reference opening 10 firefox browsers as well. Is this load testing on the backend or front end perf testing that also has a loaded system?
    – mutt
    Commented Aug 14, 2014 at 17:34

2 Answers 2

1

See, JMeter is a performance testing tool which generates load over the application and thus provides the Response Time. Like any other Load testing tool, it too never launches browser physically, it will just place calls to the application server based on the HTTP requests which are there in your script. You will not see 1 or 10 browser instances running, only calls getting places to the application can be seen in the log file of server.

JMeter WebDriver should be used to evaluate a real-life user experience. It is meant to measure the load times of pages when the system is experiencing high loads. The HTTP Request doesn’t really “render” the page and it can’t execute JavaScript. That’s why the WebDriver Sampler is so valuable - JMeter isn’t a browser and it overcomes limitations posed by this fact.

So, don’t use the WebDriver Sampler to create the load! You’ll need around 1 CPU core per virtual user to keep the JMeter resource consumption within an acceptable range.

The scenario i want to do is, I want all the 10 users to login at the same time

This you can do with JMeter, you can generate load but not multiple instances of FF, for this you need to create a test plan in JMeter and using that your all 10 users will be able to login to the application as concurrent users (based on your test plan configuration). For this task you can refer to the JMeter-Guide

It is recommended to keep the value of Thread Group = 1, when you are using "jp@gc - Web Driver Sampler" script.

https://blazemeter.com/blog/jmeter-webdriver-sampler

https://blazemeter.com/blog/webdriver-sampler-your-top-10-questions-answered

JMeter allows the creation of multiple threads, and each thread is responsible for creating load on the server. However, for the Web Driver use case, the user should be prudent in the number of threads they will create as each thread will have a single browser instance associated with it. Each browser consumes a significant amount of resources, and a limit should be placed on how many browsers the user should create. However, the load testing cloud providers may help to scale WebDriver test up to thousands of real browsers, look at BlazeMeter for example.

From experience, the number of browser (threads) that the reader creates should be limited by the following formula:

C = N + 1

where C = Number of Cores of the host running the test and N = Number of Browser (threads).

e.g., if the current reader's host has 4 cores, the formula would yield:

4 = 3 + 1

meaning that the script should have a MAXIMUM of 3 threads.
1

If you're using Jmeter for performance testing, you'd want to be informed that Jmeter doesn't open browser instances when sending web requests to the server.

How Jmeter works is, it takes all the web requests (http(s)) and hits them to the server. It doesn't open any physical browser on the client side for it. It uses its own virtual browser if any.

For hitting all the requests at the same time you might want to adjust the ramp-up time in the Thread Group. You can change the ramp-up time to increase the load gradually or rapidly. So depending on your configuration of the Thread Group & Samplers, Jmeter with hit the web requests on your server and fetch the performance results for you.

If you want that all the 10 instances must get initiated from the very start of your test you have set the ramp-up time to zero.

Happy Testing :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.