JMeter WebDriver Issue with Closing Browser

I have been playing a bit with using WebDriver (Jmeter-plugins) from within JMeter. Usually something I abhorr but it does have the occasionto do was restarting the browser (Firefox) every thread loop. This ended up in a failure every time it tried to close the browser.

The error looked like this:

2016/03/11 13:18:00 ERROR - jmeter.JMeter: Uncaught exception:  java.lang.NoClassDefFoundError: org/openqa/selenium/os/Kernel32
    at org.openqa.selenium.os.ProcessUtils.killWinProcess(ProcessUtils.java:133)
    at org.openqa.selenium.os.ProcessUtils.killProcess(ProcessUtils.java:81)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.destroyHarder(UnixProcess.java:247)
    at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:201)
    at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:125)
    at org.openqa.selenium.os.CommandLine.destroy(CommandLine.java:153)
    at org.openqa.selenium.firefox.FirefoxBinary.quit(FirefoxBinary.java:259)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.quit(NewProfileExtensionConnection.java:204)
    at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(FirefoxDriver.java:377)
    at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.java:323)
    at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:467)
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.quitBrowser(WebDriverConfig.java:269)
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadFinished(WebDriverConfig.java:244)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:612)
    at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:998)
    at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:980)
    at org.apache.jmeter.threads.JMeterThread.threadFinished(JMeterThread.java:584)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:315)
    at java.lang.Thread.run(Unknown Source)

 

Cryptic and no clue what’s going on really. But fret not, just install these two libraries into JMeter (jmeter/lib):

Restart JMeter and all should be hunky-dory!

by Oliver Erlewein

3 thoughts on “JMeter WebDriver Issue with Closing Browser

  1. Hi, I came across your site while searching for a solution for this error. Your fix didn’t work for me…may I ask what version of Firefox, JMeter, and Webdriver plugin you’re using?

    • Hi G,
      So I did this a while ago and I no longer have access to where I did this.. So I think I used Jmeter 2.13, JMeter-plugins 1.31. Firefox 38.0 (but I could be miles off with that). Hope that helps.
      Check that you have those files in the right directory and that access rights are matching (if not Windows).
      Cheers Oliver

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s