Janesh Kodikara
Janesh Kodikara

Reputation: 1821

JMeter WebDriver Sampler Groovy : Error unable to resolve class org.openqa.selenium.manager.SeleniumManager is thrown

I have JMeter 5.5 running on Mac 12.6 (21G115) with WebDriver Sampler for doing client side performance testing. It works without any issue with javascript.

enter image description here

I want to move to Groovy quickly and got following error when test was executed. It looks like a PATH issue.

2023-01-04 23:14:08,307 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[Thread Group 1-1,6,main]
java.lang.NoClassDefFoundError: org/openqa/selenium/manager/SeleniumManager
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:141) ~[selenium-remote-driver-4.7.2.jar:?]
    at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:41) ~[selenium-chrome-driver-4.7.2.jar:?]
    at 

Following Selenium jars are available in JMETER_HOME/lib/ext folder

enter image description here

Upvotes: 1

Views: 969

Answers (1)

Dmitri T
Dmitri T

Reputation: 168092

As per JavaDoc

This implementation is still in beta, and may change. The Selenium-Manager binaries are distributed in a JAR file (org.openqa.selenium:selenium-manager) for the Java binding language

I fail to see any sign of selenium-manager jar in your beautiful screenshot hence you're getting the error.

If you want to instantiate the WebDriver yourself - move to JSR223 Sampler and make sure that selenium-manager is in your classpath.

ChromeDriver is being managed by Chrome Driver Config so you can just add it, provide the path to your chromedriver executable and refer it in your script as WDS.browser

enter image description here

The above code should work just fine assuming you've installed WebDriver Sampler using JMeter Plugins Manager

Also "lib/ext" folder is for JMeter Plugins, dependency libraries should go "lib" folder, see JMeter Classpath section for more details.

Upvotes: 1

Related Questions