0

I am executing the Jmeter test plan on Ubuntu Server but at the end left with an error saying:

Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/opt/testScripts/LcLoadTesting/agentsAccessTheCustomerInfo.jmx'. Cause: CannotResolveClassException: com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler

The whole error is:

Error in NonGUIDriver java.lang.IllegalArgumentException: Problem loading XML from:'/opt/testScripts/LcLoadTesting/agentsAccessTheCustomerInfo.jmx'.
Cause:
CannotResolveClassException: com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler

 Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       :
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jmeter.save.ScriptWrapper
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler
line number         : 29
version             : 5.2.1
-------------------------------
An error occurred: Error in NonGUIDriver Problem loading XML from:'/opt/testScripts/LcLoadTesting/agentsAccessTheCustomerInfo.jmx'.
Cause:
CannotResolveClassException: com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler

 Detail:com.thoughtworks.xstream.converters.ConversionException:
---- Debugging information ----
cause-exception     : com.thoughtworks.xstream.converters.ConversionException
cause-message       :
first-jmeter-class  : org.apache.jmeter.save.converters.HashTreeConverter.unmarshal(HashTreeConverter.java:67)
class               : org.apache.jmeter.save.ScriptWrapper
required-type       : org.apache.jmeter.save.ScriptWrapper
converter-type      : org.apache.jmeter.save.ScriptWrapperConverter
path                : /jmeterTestPlan/hashTree/hashTree/hashTree/com.googlecode.jmeter.plugins.webdriver.sampler.WebDriverSampler
line number         : 29
version             : 5.2.1
-------------------------------

Can anyone please help me in this how can I resolve it so that I could successfully run the test plan on Ubuntu Server.

  • yes, you can visit this link Click here where I have run the test in windows OS. From this, you'll get the test plan format. – Rajan Apr 28 at 9:12
1

It seems that you're using the WebDriver Sampler in your Test Plan and your JMeter installation on Ubuntu doesn't have this plugin installed.

The solution is to install the plugin, it can be done using JMeter Plugins Manager

  1. Get the Plugins Manager:

    wget https://jmeter-plugins.org/get/ -O /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar
    
  2. Get JMeter Plugins Command Line Runner:

    wget https://repo1.maven.org/maven2/kg/apc/cmdrunner/2.2/cmdrunner-2.2.jar -P /opt/apache-jmeter-5.2.1/lib/
    
  3. Generate Plugins Manager command line utility:

    java -cp /opt/apache-jmeter-5.2.1/lib/ext/jmeter-plugins-manager.jar org.jmeterplugins.repository.PluginManagerCMDInstaller
    
  4. Install the WebDriver Sampler plugin:

    /opt/apache-jmeter-5.2.1/bin/./PluginsManagerCMD.sh install jpgc-webdriver
    

Replace /opt/apache-jmeter-5.2.1 with the full path to your JMeter installation and your test should work after executing of the above 4 commands.

| improve this answer | |
  • First two steps go fine but in the third one I got an error saying: Error: Could not find or load main class org.jmeterplugins.repository.PluginManagerCMDInstaller Caused by: java.lang.ClassNotFoundException: org.jmeterplugins.repository.PluginManagerCMDInstaller What can I do in this case to resolve this. – Rajan Apr 28 at 10:56
  • Most probably you made a mistake or typo somewhere, I cannot state where exactly without seeing all the commands output – Dmitri T Apr 28 at 11:27
  • By seeing your answer I got an idea and place the needed jars in respective folders of JMeter i.e. /lib/ext. And now the test plan executed but not in a way that it should be. I have print the logs for more information and I got one error from chrome driver i.e. java.lang.IllegalStateException: The driver is not executable: /opt/chromeDriver/chromedriver at com.google.common.base.Preconditions.checkState(Preconditions.java:585) ~[guava-25.0-jre.jar:?]. Can you tell me this why it's not working? If you want a seprate question for this then I will post it accordingly within a minute ?? – Rajan Apr 28 at 12:01
  • 1
    You need to make it executable using chmod command like chmod +x /opt/chromeDriver/chromedriver. And looking into my magic ball I can predict that the next question will be "my browser doesn't start" so get familiarized with Driving Headless Browser Testing with Selenium and Python article – Dmitri T Apr 28 at 12:05
  • 1
    If you want to automate Chrome browser you need to have it installed, don't you? wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb and sudo apt install ./google-chrome-stable_current_amd64.deb should do the trick for you. See Using Selenium with JMeter's WebDriver Sampler for more details – Dmitri T Apr 28 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.