jmeter is opening many firefox session(threads) when integrated with selenium using jar approach - selenium-rc

I am currently using the jar of my selenium test suite to integrate with JMeter but, the problem which I am facing is that JMeter is opening the Firefox session equals to the number of threads which I specify because of that, my system gets unresponsive.
Does any one knows how to suppress multiple browser session to open on system without affecting the load testing?

It is normal each thread open his own browser... Maybe you can use phantomJS driver but ut will use memory too... Maybe not use this way and use recording controller to record scenario an play it directly with jmeter that is the stress test way the other not test the performance... You can use chrome headless too but cost memory too.. Another solution start new thread only when first thread us finish... I think with versiin 45 of firefox (only version working with jmeter) and jmeter 3.3 firefox not possible headless... Google an phantomJS yes possible.
The best solution use recorder controller.. Record a case and play it... Jmeter will use internal browser "system" low cost to achieve it dont forget that jmeter is stress test tool... You can use to do other action but not efficiently...

Related

Is there any way No Correlation need for JMeter Script?

Is there an script recorder for JMeter (jmx) in which No Correlation is NOT needed. Just like "TruClient" Protocol in LoadRunner.
The script created with TruClient does not require any Correlation.
Thanks
There are few options available.
Please check
JCorrelate
video demo
Blazemeter Auto correlation Plugin
Detailed article
Naveen has explained the process in this video
Ubik auto correlation plugin for
TruClient is not a "protocol", LoadRunner just launches a real browser (a headless one) and controls it.
JMeter equivalent would be WebDriver Sampler, if you're looking for recording solution for Selenium the options are in:
Selenium IDE
JMeter Chrome Extension
However be informed that real browsers are quite resource intensive, for example Firefox 95 needs a CPU core and 2 GB of RAM per instance so for 100 users you will need 101 CPUs and 200 GB of RAM which is kind of expensive.
Moreover:
As per WebDriver Sampler introduction
Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.
As per Selenium documentation
Performance testing using Selenium and WebDriver is generally not advised. Not because it is incapable, but because it is not optimised for the job and you are unlikely to get good results.
So I would recommend keeping your test on HTTP protocol level without browsers involved, if you have problems with implementing correlation - take a look at BlazeMeter Test Recorder capable of exporting recorded scripts in "SmartJMX" format with automatic detection and correlation of dynamic parameters.

JMeter with Selenium WebDriver Sampler actually overload the overload PC

I run test in Jmeter with Selenium WebDriver Sampler
on Linux X86 and java SDK 11
The test run with 50 users.
I run it from the command line with non Gui mode and with Chrome headless mode.
but after 5 minutes the CPU going up to 100% and the memory almost full (8G).
What can I do to improve it?, I need run the test with 200 users and up.
Thanks,
Izik
You're expecting too much from your machine.
Although there are no specific RAM requirements defined at the Chrome System Requirements page, on my machine a single Chrome instance with a single tab in "porno" mode consumes almost 1GB of RAM. And this is given http://example.com page open, not modern web application with tons of JavaScript
I bet if you run the following command on your machine - you will get at least 3GB
(Get-Process chrome | Measure-Object WorkingSet -sum).sum
As per WebDriver Sampler tutorial
Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.
So my expectation is that you should be conducting the load using HTTP Request samplers and forget about using real browsers (or use 1 instance to collect client-side performance metrics). Just consider following recommendations from How to make JMeter behave more like a real browser article to ensure that protocol-based JMeter test has the same network footprint as real browser produces.
If you have to use real browsers for performance testing you won't be able to launch 200 browser instances on a machine with 8GB of RAM, you will have to find another 30-40 machines of this specifications and go for Distributed Testing.
This is expected, Since you are using Selenium it will use the JVM and browser which will consume a lot of memory. I would suggest you to distribute the test in multiple machine if you are going the Selenium route for load testing. This way you will be able to load test for more more number of users.
The best would be to stick to HHTP sampler as suggested above. You could also record and make necessary changes.

My Jmeter Webdriver sampler test is too heavy on my machine. I'm planning to use selenium grid, with selenium grid ,will it make my test more lighter?

My Jmeter Webdriver sampler test is too heavy on my machine. I'm planning to use selenium grid, with selenium grid ,will it make my test more lighter? As of the moment while running my test on gui and non gui mode I'm encountering a web driver timeout , connection timeout, and an out of memory error. Will this approach help?
Have you tried to read WebDriver Sampler's documentation?
Note: It is NOT the intention of this project to replace the HTTP Samplers included in JMeter. Rather it is meant to compliment them by measuring the end user load time.
You should not be creating the main load using WebDriver Samplers, 99.99999% of the virtual users should be simulated on HTTP protocol level, WebDriver Sampler could be used only for specific use cases like OAuth login, checking client side performance, etc.
Check out How to make JMeter behave more like a real browser article to learn how to properly setup JMeter for web applications testing so it would generate the same network footprint as the real user using the real browser.
If your have a form of a strict requirement to use the real browsers - consider switching to Distributed Testing as in case of Selenium Grid you will not be able to collect samplers execution metrics precisely.

How to use headless browser via Jmeter GUI

I tried to use the all jmeter's drivers to create headless browser, but unfortunately without success. HtmlUnit Driver works, but doesn't run the javascript, when i run the both Chrome and PhantomJs drivers, i getting the Exception:
java.lang.IllegalArgumentException: Browser has not been configured. Please ensure at least 1 WebDriverConfig is created for a ThreadGroup.
Below my Phantom and Chrome configurations:
Looking into the error you're getting it seems that your Chrome Driver Config and/or PhantomJS Driver Config are not enabled, you need to make the Config element active via Edit -> Toggle menu or pressing Ctrl+T.
Be aware that you can run in fact any browser in headless mode, on Linux you can use virtual framebuffer and on Windows you can just run JMeter as LocalSystem account. Check out Headless Execution of Selenium Tests in Jenkins guide for comprehensive instructions.
Also be informed that even in headless mode real browser footprint in terms of CPU and RAM usage will still be immense so I wouldn't recommend using real browsers for creating the main load, you should stick to JMeter's HTTP Request samplers instead and if needed use single real browser instance via WebDriver Sampler integration for client-side performance checks.
I found the solution myself. If the machine with Jmeter on linux, you should give the permissions to run the executable:
chmod 755 "path to you driver executable file"
Thanks to: https://stackoverflow.com/a/40556732/5279455

JMeter HTTP Test Script Recorder randomly stops recording

I am creating recordings for a company website for performance tests. Normally this works fine though on occasion when starting a new test recording, HTTP Test Script Recorder will not record anything but returns the following error in the browser:
I have been using jmeter for a while now so I know the setup for HTTP Test Script Recorder is ok.
Clearing browser history, running in public or private mode doesn't help. Re-issuing jmeter proxy cert makes no difference either, the same for deleting proxyserver.jks.
Having experienced this before, I know that after a few days HTTP Test Script Recorder will start working again.
Happens for both jmeter v4 & v5.
I can think only of one situation when it can happen:
You have a JMeter test running in background (or a thread which failed to stop for some reason)
You're trying to record something at the same time
So
Make sure that nothing is running at the moment (you should see 0/0 in upper right corner of JMeter GUI)
Start clean recording session, to wit restart JMeter and create the test plan using Recording Template feature (From main menu choose File -> Templates -> Recording and click "Create"
Just in case be aware that you can also record your mobile application traffic using cloud-based proxy service, as a bonus you will get possibility to export recorded scripts in SmartJMX mode with automated detection and correlation of the dynamic parameters. Check out How to Cut Your JMeter Scripting Time by 80% article for more details if interested.
The issue you see is most probably a bug probably introduced by:
https://bz.apache.org/bugzilla/show_bug.cgi?id=57962
During recording, JMeter variables are null so we end up using an Unmodifiable version of them because of this:
https://github.com/apache/jmeter/blob/trunk/src/core/org/apache/jmeter/threads/JMeterContext.java#L88
I suggest you open a bug here, providing as much information as possible:
https://jmeter.apache.org/issues.html
Provide:
How you reproduce it
The jmeter.log with the stacktrace (not as an image)
The workaround is to avoid running a test and recording after that.
Edit on 3 december 2018:
You reported a bug:
https://bz.apache.org/bugzilla/show_bug.cgi?id=62916
The reproducer is:
Start a distributed test where Controller is in GUI mode and a jmeter-server
Once test is finished, start a Recording using HTTP(S) Test Script Recorder
Hit a URL, you'll get the issue
The bug has been fixed today, it will be available in JMeter 5.1 and is already available in:
https://ci.apache.org/projects/jmeter/nightlies/

Resources