0

i try to do performance test for my website . i use jmeter in this test and i created already Test plan. this is the project i still getting the below error and i don't know how to solve

2023-07-04 19:32:06,010 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[Thread Group 1-1,6,main]
java.lang.NoSuchMethodError: 'com.google.common.collect.ImmutableMap com.google.common.collect.ImmutableMap.of(java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object, java.lang.Object)'
    at org.openqa.selenium.chrome.AddHasCasting.getAdditionalCommands(AddHasCasting.java:38) ~[selenium-chrome-driver-4.9.1.jar:?]
    at org.openqa.selenium.chrome.ChromeDriver$ChromeDriverCommandExecutor.getExtraCommands(ChromeDriver.java:116) ~[selenium-chrome-driver-4.9.1.jar:?]
    at org.openqa.selenium.chrome.ChromeDriver$ChromeDriverCommandExecutor.<init>(ChromeDriver.java:111) ~[selenium-chrome-driver-4.9.1.jar:?]
    at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:101) ~[selenium-chrome-driver-4.9.1.jar:?]
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88) ~[selenium-chrome-driver-4.9.1.jar:?]
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:84) ~[selenium-chrome-driver-4.9.1.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:28) ~[jmeter-plugins-webdriver-4.9.1.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:14) ~[jmeter-plugins-webdriver-4.9.1.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:221) ~[jmeter-plugins-webdriver-4.9.1.0.jar:?]
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:152) ~[jmeter-plugins-webdriver-4.9.1.0.jar:?]
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:802) ~[ApacheJMeter_core.jar:5.6]
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:1029) ~[jorphan.jar:5.6]
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:1012) ~[jorphan.jar:5.6]
    at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:770) ~[ApacheJMeter_core.jar:5.6]
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:758) ~[ApacheJMeter_core.jar:5.6]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:264) ~[ApacheJMeter_core.jar:5.6]
    at java.lang.Thread.run(Thread.java:833) [?:?]
2023-07-04 19:32:06,010 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2023-07-04 19:32:06,011 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

i tried everything with no chance

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • This link could help. https://stackoverflow.com/questions/71095560/java-lang-nosuchmethoderror-com-google-common-collect-immutablemap-error-when – lucas-nguyen-17 Jul 05 '23 at 01:48

1 Answers1

0

I cannot reproduce your issue, most probably you're suffering from a form of a Jar Hell, perform clean installation of JMeter and WebDriver Sampler plugin and the issue will go away.

enter image description here


In general with regards to your "i try to do performance test for my website" stanza I don't think using Selenium is a good idea mainly because:

  1. You won't be able to generate that many load with the WebDriver Sampler as with normal HTTP Request sampler because WebDriver Sampler kicks off a real browser and browsers are very resource intensive

  2. It's not recommended by Selenium developers

    Performance testing using Selenium and WebDriver is generally not advised. Not because it is incapable, but because it is not optimised for the job and you are unlikely to get good results.

  3. It's not recommended by WebDriver Sampler plugin developers

    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.

So I would suggest reconsidering your approach and switch to HTTP Request samplers, given you configure JMeter to behave like a real browser your test will generate the same network footprint as the browser does with much less resources consumption and much better metrics generated.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133