1

Here are the steps I have followed so far....

  1. Recorded steps using Selenium IDE

  2. Then I export it (".side" file) into a java(junit 4) file.

  3. Created a maven project and added the necessary libraries. (The project runs as expected)

  4. Created jar file using maven-shade-plugin

  5. Added the necessary jars to jMeter

  6. Add the library(snapshot) to the jmeter lib --> junit folder

  7. Restarted jmeter

  8. At this moment I'm not allowed to add thread group or other option.(Place where I face the problem)

Then, I tried it creating a java project without maven. But it doesn't capture assert function. Tried to add libraries but that didn't work.

I added jUnit 5 also and that didn't work either.

How can I write integrate exported java file with jMeter?


So far this is the solution I have found. I did a slight change in the 3rd step.
I was using intellij idea. Instead I used eclipse and created normal jar file and followed rest of the given steps. This will work.

But still didn't check whether the problem with plugin I used.

1
  • are you mainly recording to create a jmx file to do a performance test? Could you use Blazemeter for this?
    – Decypher
    May 29, 2019 at 13:29

1 Answer 1

1

Running a Selenium script recorded using Selenium IDE along with JMeter involves integrating the Selenium WebDriver with JMeter. This allows you to execute the recorded Selenium script as part of a performance test in JMeter. Below are the steps to achieve this:

Step 1: Install JMeter Ensure you have JMeter installed on your system. You can download the latest version of JMeter from the Apache JMeter website (https://jmeter.apache.org/download_jmeter.cgi).

Step 2: Add Selenium/WebDriver Support to JMeter To enable Selenium support in JMeter, you need to add the necessary plugins:

Download the "WebDriver Sampler" plugin (https://jmeter-plugins.org/get/). Place the downloaded .jar file into the "lib/ext" folder of your JMeter installation.

Step 3: Create a Test Plan in JMeter Open JMeter and create a new Test Plan:

Right-click on "Test Plan" and select "Add" -> "Threads (Users)" -> "Thread Group". Right-click on the Thread Group and select "Add" -> "Config Element" -> "HTTP Cookie Manager" to manage cookies. Right-click on the Thread Group and select "Add" -> "Sampler" -> "jp@gc - WebDriver Sampler".

Step 4: Configure the WebDriver Sampler In the WebDriver Sampler, you'll set up the browser and provide the Selenium script recorded using Selenium IDE:

Click on the "WebDriver" tab in the WebDriver Sampler. Choose the desired browser (e.g., Chrome or Firefox). If necessary, specify the path to the browser executable in the "Browser Executable Path" field. In the "Script" section, paste the recorded Selenium script.

Step 5: Run the Test Plan Once you have configured the WebDriver Sampler with the Selenium script:

Save your JMeter Test Plan. Click on the "Play" button or select "Run" -> "Start" from the menu to execute the test. JMeter will now run the Selenium script along with other samplers and components in the Test Plan.

Important Notes:

Ensure that the browsers (e.g., Chrome, Firefox) and corresponding WebDriver binaries are installed on the machine where you run the test. Keep in mind that running Selenium scripts with JMeter can consume significant resources, and the number of threads/users you configure in the Thread Group will determine the concurrency level.

With these steps, you can successfully run a Selenium script recorded using Selenium IDE along with JMeter to perform performance testing and measure the response times of your web application under different loads.

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.