JMETER and Selenium WebDriver are experiencing issues with executing multiple threads efficiently

Currently, I am attempting to execute a test for 5 - 10 users using WebDriver Sampler within JMeter. I have successfully configured Chrome Driver and included the necessary WebDriver Sampler code. Interestingly, when running the test for only 1 user, everything works as expected without any issues. However, as soon as I attempt to run it for multiple users, the test fails at certain points where some dropdowns cannot be located. Only one thread passes while the others fail. Is there a way to run the test for multiple threads simultaneously in the background?

Here is the structure of my JMeter configuration for reference.

I have experimented with the WebDriver Sampler for 5 - 10 users, but it only seems to work for 1 user so far. I hope to achieve similar success across all threads. Alternatively, could someone provide guidance on how to execute the same code in Headless mode?

Answer №1

Avoid using Selenium for performance testing.

According to the Selenium website:

It is generally not recommended to perform performance testing with Selenium and WebDriver. While they are capable, they are not optimized for this purpose and may not provide accurate results.

The JMeter Plugins website also states:

It is not the goal of this project to replace the HTTP Samplers in JMeter. Instead, it aims to enhance them by measuring end user load time.

Instead of troubleshooting issues with multiple browsers, it is suggested to switch to the HTTP protocol and configure JMeter to simulate a real browser.


In response to your questions:

  • Ensure your computer meets the necessary requirements. For example, Firefox 114 requires 1 CPU core and 2 GB of RAM per instance. If your machine has less than 24 GB of RAM, it is not advisable to run 10 browsers simultaneously.
  • If "dropdowns" do not appear immediately, consider adjusting default timeouts or utilizing Selenium Waits.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The command driver.quit() triggers an error in Firefox, causing the browser to crash

When the driver.quit() method is called, it causes Firefox to stop working. Although the tests do not fail, every time driver.quit is executed, the browser crashes as seen in the image below. This is my code snippet: public void quitDriver() throws E ...

The animation for moving elements is not presenting itself

My current package versions are as follows: NUnit(3.13.3) Microsoft.test.Sdk(17.5.0) NunitTestAdapter(4.4.2) Selenium.Webdriver(4.16.2) In addition, here is the code snippet I am working with: public void ActionWithElement() { var dragMe = _driver.Fin ...

Having trouble with accessing an element that contains both onclick and text attributes in Selenium Webdriver?

The HTML code I'm dealing with includes this element: <a style="text-decoration:none; font-weight:normal;" href="javascript:void(0);" onclick="CreateNewServiceItemApproved();"> <img src="icons/ui/addnew.png"> <span style="color:# ...

The problem persists in Selenium Webdriver with Java despite attempts with implicit wait and explicit wait methods

Recently, I have been running tests on an application that involves multiple ajax calls. To ensure that elements are present/visible once the ajax call is made, I implemented wait conditions using both implicitwait and explicitwait. However, I encountered ...

Set up GitLab CI to execute feature tests using rspec, selenium, and the Firefox browser

Just diving into gitlab CI and seeking guidance on setting up gitlab-ci to execute feature tests with Firefox (Ruby 2.7 / Rails 6 / Rspec / Capybara). All good except for the feature tests. I suspect that there's something I need to configure with Fi ...

Exception handling: Either a timeout occurred or the element could not be found

@Test public void TC8() { driver.findElement(By.id("id_username")).sendKeys("admin"); driver.findElement(By.id("id_password")).sendKeys("admin"); driver.findElement(By.cssSelector("button,input[type=' ...

The getTitle() function of the Selenium driver seems to be malfunctioning

Why is driver.getTitle() returning null instead of the title of the page? The HTML structure in my web page is as follows: <head> <!-- needed for translation of titles --> <!-- needed for gomez.jsp --> <script type="text/javasc ...

Tips for Combining Chrome driver service with desired capabilities for headless mode using xvfb?

I am looking to combine the functionalities of ChromeDriverService with either chromeOptions or DesiredCapabilities in order to run the browser in xvfb. Below is a snippet of code related to ChromeDriverService that I had previously used without selenium ...

Java Selenium WebDriver code for logging into Gmail

I have encountered an issue with my code designed to log in to GMail, where it stops at the email id entry and displays the following error message: Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to locate element: {"method" ...

Resolving a NullPointerException in Selenium Java JUnit Test Cases

Encountered a puzzling error while running a test in navigateAllMenus.java. When the script tries to locate loginLink, it halts and throws a java.lang.NullPointerException on line 28: _a_LoginPage.loginLink(driver).click();. Despite attempting different x ...

I'm looking for assistance with my code - I am attempting to utilize Selenium and WebDriver in order to click on articles on Google's latest website by using XPATHs. Can anyone lend a hand?

I'm currently working on a script to automate the process of selecting articles from random categories on Google's news site. I am using selenium for educational purposes but I am facing challenges in getting the code to function properly. Even t ...

The Robot Class is experiencing issues with file uploads in Internet Explorer 11 when using Selenium WebDriver

I am facing an issue when trying to upload a file using selenium webdriver in IE11 with Java. The code I have is able to click on the Browse button, but it gets stuck without entering or pasting the file name into the newly opened window. It seems that the ...

Locate element and perform a click action with VBA Selenium

I attempted to choose the highlighted Xpath in the image below and then proceeded to click on the element. Here is a snippet of the code I tried: On Error Resume Next Set Element = GC.FindElementByXPath("//*a[@data-id='_VIEW--ALL_COMPLAINTS_VIEW_P&ap ...

Encountering the error "java.lang.IndexOutOfBoundsException: Index: 1, Size: 1" while attempting to choose the second option in the dropdown menu

I need to choose the third option from a drop-down list that is enclosed in a div element. However, when I try to retrieve the items in the drop-down using Selenium, the size of the drop-down list is only showing as 1 even though there are actually 10 it ...

Instructions on how to display a list of distinctive icons featured in article headlines along with their respective usage frequency

Visit this website for the latest news. Count the number of articles displayed on the page and identify all unique icons used in the articles. ...

Issue encountered with Windows Handle Selenium operation

Here is the code I wrote to validate a new window opening after clicking on a link: package pages; import java.io.IOException; import org.openqa.selenium.By; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotatio ...

Utilizing Selenium with Java: Extracting Data from a Single Dropdown Menu (Time Selection)

Hey there: I am facing an issue with extracting data from a calendar field. I am trying to extract the information (HH.MM.AM/PM) from a single date field, but so far, it has been unsuccessful. This is the code snippet I have been using: WebElement currT ...

Tips for choosing an element created by JavaScript code

I need help selecting the Wireless button on a pop-up window that appears within the same window. There are no iFrames generated and I'm unable to locate any elements inside this Wifi-Connect window. Any suggestions? Here is the code I've attem ...

Displaying cursor in Selenium Webdriver with s

As I develop a Selenium Webdriver script using Python, my current challenge involves executing actions that involve moving to a specific spot and performing a click. However, I encountered an issue where these actions are not working as expected. To troubl ...

Effective communication among docker containers

I am currently managing a server with two Docker containers. One of the containers serves as a web server, while the other is dedicated to running selenium-chromedriver. My goal is to establish a connection from the web server container to the chrome dri ...