java - JMeter Selenium 插件 Kernel32 异常

标签 java selenium jmeter

我已经尝试为 JMeter 设置 Selenium 插件一天了,但我不知道如何解决这个异常。我尝试过更换 Selenium jar ,切换版本,但我仍然得到这个。

JMeter版本:2.13 Selenium 库:2.46.0

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:248)
at org.openqa.selenium.os.UnixProcess$SeleniumWatchDog.access$200(UnixProcess.java:200)
at org.openqa.selenium.os.UnixProcess.destroy(UnixProcess.java:124)
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:202)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.quit(FirefoxDriver.java:376)
at org.openqa.selenium.firefox.FirefoxDriver.stopClient(FirefoxDriver.java:322)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:477)
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)

最佳答案

这看起来像是插件打包问题,可能是由 JMeter 附带的库与 WebDriver 插件附带的库之间的冲突引起的。

检查 JMeter 安装的/lib 文件夹,检测具有相同名称但不同版本的库并删除重复项。

参见The WebDriver Sampler: Your Top 10 Questions Answered有关更多 WebDriver 采样器提示和技巧的指南。

关于java - JMeter Selenium 插件 Kernel32 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32731978/

相关文章:

java - 无法使用 java 连接到 MySQL,除非其本地主机

python - 用selenium python模拟一个onclick

java - 未捕获 SQLiteConstraintException

java - 使用现有的 Java 类作为 XSD 中的类型

java - 无法通过 xpath 鼠标悬停

javascript - Selenium JS 添加 cookie 到请求

jmeter - 从数组中获取随机值

xml - 具有多个请求的 jMeter Soap 测试

testing - 如何在jmeter的预处理器中使用__eval

java图像加载与效果