jp#gc - Chrome Driver Config - jmeter

I would like to automate my JMeter recorded scripts using jp#gc - Chrome Driver Config to execute in chrome tab. Is there any way to run my recorded script in Chrome Driver Config without using javascript in jp#gc - WebDriver Sampler ?.
I am using Apache JMeter 3.2 version and for reference I have attached screenshot of my Test Plan, please verify it.

JMeter acts on HTTP protocol level so it is not possible to convert recorded HTTP requests into full browser tests. You can convert existing Selenium tests into JMeter ones, but not in the opposite direction.
You can try using i.e. Selenium IDE to record your UI-based scenario, export it to Java language and use them as a basis for your WebDriver Sampler based scripts (it supports variety of languages), however you will still need to amend the recorded script as the code, generated by Selenium IDE won't be consumed by the WebDriver Sampler "as is"

Related

How integrate Selenium code in JMeter How this is achieve

I create a maven project using selenium web driver in eclipse to automate one web-based application. Here I also used TestNG and the programming language Java. Now I want to integrate this selenium project into JMeter and want to do performance testing so how can I achieve this?
Although it's possible to kick off a TestNG test programmatically from JMeter's JSR223 Sampler using the code like:
TestListenerAdapter tla = new TestListenerAdapter()
TestNG testng = new TestNG()
testng.setTestClasses(new Class[] { YourClassWithTests.class })
testng.addListener(tla)
testng.run()
I don't think you will get the results you're looking for.
The main limitations are:
In general it's not advised to use Selenium for performance testing
You won't get metrics and KPIs like number of concurrent users, connect time, response time, etc.
Test will be very resource intensive as one instance of browser requires 1 CPU core and a couple of gigabytes of RAM so the resource footprint will be immense.
So I would recommend converting your Selenium tests to "pure" JMeter, you can kick off JMeter's HTTP(S) Test Script Recorder and configure your Selenium tests to use JMeter as the proxy, this way JMeter will be able to intercept the relevant HTTP requests and create HTTP Request samplers which are lightweight comparing to the real browsers and this way you will get all the metrics.

Jmeter Recording xml issue

I am trying to record a script for web application (https protocol)using jmeter-5.3. The xml file in the view result tree of HTTP(S) Test Script Recorder is capturing all the calls. but once I finished my recording and check the xml file doesn't have the calls(the first 3-4 transaction calls) in the beginning of the script in the xml. why its happening and how can I fix it?
According to JMeter Best Practices you should be using the latest version of JMeter so consider upgrading to JMeter 5.4.3 (or whatever is the latest version which is available at JMeter Downloads page)
Check "Grouping" setting of the HTTP(S) Test Script Recorder, it might be the case you have Store 1st sampler of each group only selected and it can discard important requests:
Make sure to use Recording Template as it generates good and valid recording test plan
Check jmeter.log file for any suspicious entries
Try alternative way of recording a JMeter test i.e. JMeter Chrome Extension and see whether all requests which should be captured are captured.

Can jmeter cli tools record a test script?

I am new to jmeter. Creating a simple script seems easy via browser actions recording. Can that be done without launching the jmeter IDE?
As per latest stable JMeter version 5.4.1 it's not possible to start HTTP(S) Test Script Recorder without starting JMeter GUI
If you cannot do this for any reason the options are in:
Use JMeter Chrome Extension
Use your browser developer tools to record your test request into a .HAR file, once done you can:
either use online conversion tool to convert .har file into a JMeter script
or manually create JMeter's HTTP Request samplers by looking into requests details in the browser developer tools. If you cannot launch JMeter GUI at this stage as well you can consider using Taurus automation framework which allows creation of JMeter test plans using YAML syntax
You need to start the JMeter proxy for recording the test and it is not possible to start the proxy through available options.
There is a number of ways available for building test plans including the HTTP(S) Test Script Recorder.
Ten different ways to build JMeter Test Plans
The recording feature can be used even for complex scripts. You will have to use/add JMeter components and configure them once the recording is done to achieve the desired user actions.

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.

Specflow (cucumber) for Load Test (Jmeter)

Is there a way to create JMeter load test plan from .feature files? I have been looking around and I did not find any existing framework or a way to use existing specflow's feature files to create JMX files.
I don't think this is currently supported.
If you use Specflow/Cucumber for running Selenium tests (or your tests use HTTP/HTTPS protocol(s) you can configure your WebDriver initialization to use JMeter's HTTP(S) Test Script Recorder as a proxy for Selenium WebDriver instances so when you run your Specflow/Cucumber test JMeter will capture the requests coming from browsers and convert them into HTTP Request samplers.
This way you will be able to build a JMeter test plan out of your existing functional test and replay it with increased number of users. See How to Convert Selenium Scripts into the JMX Converter for more details.
As an alternative you can consider Ruby-JMeter DSL or Taurus tool which allow creating JMeter tests declaratively.

Resources