You created yourself a Jar Hell <https://dzone.com/articles/what-is-jar-hell>, you need to remove everything from *<dependencies> *section and ensure that your Selenium code is using Selenium API for version 3.141.59 <https://www.javadoc.io/doc/org.seleniumhq.selenium/selenium-api/3.141.59/index.html> as it comes withWebDriver Sampler 3.3 <https://mvnrepository.com/artifact/kg.apc/jmeter-plugins-webdriver/3.3> as the transitive dependency
<https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Transitive_Dependencies>

All extra libraries you want to add to JMeter need to be specified exactly as per Adding Excluding libraries to from the classpath <https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Adding-Excluding-libraries-to-from-the-classpath> section  of JMeter Maven Plugin documentation.

More information: How to Use the JMeter Maven Plugin <https://www.blazemeter.com/blog/how-use-jmeter-maven-plugin>


On 9/3/2022 9:31 AM, Divyang Raval wrote:
Hi Everyone,

Did anyone tried executing UI tests from Jmeter using Webdriver sampler on jenkins or remote machine?

Issue:
While trying to run Jmeter-Webdriver Sampler through Jmeter-Maven integration it fails to start browser and throwing this error.
[*INFO] ChromeDriver was started successfully.*
*[INFO] Uncaught Exception java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeDriver.<init>(Lorg/openqa/selenium/chrome/ChromeDriverService;Lorg/openqa/selenium/Capabilities;)V in thread Thread[PJ API + UI Tests 2-1,5,main]. See log file for details.*

Complete Log:
java.lang.NoSuchMethodError: org.openqa.selenium.chrome.ChromeDriver.<init>(Lorg/openqa/selenium/chrome/ChromeDriverService;Lorg/openqa/selenium/Capabilities;)V at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:83) ~[jmeter-plugins-webdriver-3.3.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:21) ~[jmeter-plugins-webdriver-3.3.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:234) ~[jmeter-plugins-webdriver-3.3.jar:?] at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:221) ~[jmeter-plugins-webdriver-3.3.jar:?] at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:797) ~[ApacheJMeter_core-5.5.jar:5.5] at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:993) ~[jorphan-5.5.jar:5.5] at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:976) ~[jorphan-5.5.jar:5.5] at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:765) ~[ApacheJMeter_core-5.5.jar:5.5] at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:753) ~[ApacheJMeter_core-5.5.jar:5.5] at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:264) ~[ApacheJMeter_core-5.5.jar:5.5]
at java.lang.Thread.run(Thread.java:834) ~[?:?]

However Interesting thing is, same script is working fine when we execute from Jmeter UI.

So issue is only when we use Jmeter Maven plugin to download dependencies and execute them.

I have attached my sample POM file, in case any specific dependency is missing.

Looking forward to hear from you.

Thanks,
Divyang Raval

---------------------------------------------------------------------
To unsubscribe, e-mail:user-unsubscr...@jmeter.apache.org
For additional commands, e-mail:user-h...@jmeter.apache.org

Reply via email to