Jmeter |插件1.3 - 启动Webdrivertest时出错

时间:2015-07-21 07:53:42

标签: selenium-webdriver jmeter jmeter-plugins

我只是尝试使用插件Extras,Hadoop,ExtraLibs和Webdriver在Jmeter上启动webdrivertest。 (全部1.3.0) 当我尝试启动脚本时出现以下错误:

Chrome + IE:

jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:68)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:56)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:60)
    at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:251)
    at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.<init>(ApacheHttpClient.java:228)
    at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:89)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:63)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:58)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.<init>(DriverCommandExecutor.java:47)
    at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:61)
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.createBrowser(ChromeDriverConfig.java:21)
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233)
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:610)
    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.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)




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: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.remote.service.DriverService.stop(DriverService.java:190)
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.quitBrowser(ChromeDriverConfig.java:69)
    at com.googlecode.jmeter.plugins.webdriver.config.ChromeDriverConfig.quitBrowser(ChromeDriverConfig.java:21)
    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)

Firefox:

jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: Could not initialize class org.apache.http.conn.ssl.SSLConnectionSocketFactory
    at org.openqa.selenium.remote.internal.HttpClientFactory.getClientConnectionManager(HttpClientFactory.java:68)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:56)
    at org.openqa.selenium.remote.internal.HttpClientFactory.<init>(HttpClientFactory.java:60)
    at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.getDefaultHttpClientFactory(ApacheHttpClient.java:251)
    at org.openqa.selenium.remote.internal.ApacheHttpClient$Factory.<init>(ApacheHttpClient.java:228)
    at org.openqa.selenium.remote.HttpCommandExecutor.getDefaultClientFactory(HttpCommandExecutor.java:89)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:63)
    at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:58)
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:95)
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:275)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:116)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:220)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:215)
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:95)
    at com.googlecode.jmeter.plugins.webdriver.config.FirefoxDriverConfig.createBrowser(FirefoxDriverConfig.java:21)
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.getPreparedBrowser(WebDriverConfig.java:233)
    at com.googlecode.jmeter.plugins.webdriver.config.WebDriverConfig.threadStarted(WebDriverConfig.java:220)
    at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:610)
    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.threadStarted(JMeterThread.java:579)
    at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:567)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
    at java.lang.Thread.run(Unknown Source)

Apache JMeter版本2.13
Java 1.8.0.45

我也使用Jmeter 2.13和相同的插件(1.2.1),它完美地工作。但是为了测试我需要1.3插件。

有没有人使用Jmeter和插件1.3并得到同样的错误?

2 个答案:

答案 0 :(得分:13)

你有一个问题你在lib中有不同版本的同一个JAR:

  • 的HttpClient-4.2.6.jar
  • 的HttpClient-4.5.jar
  • 的HttpCore-4.2.5.jar
  • 的HttpCore-4.4.1.jar
  • httpmime-4.2.6.jar
  • httpmime-4.5.jar

您需要保留每个版本的最新版本,而不是两者。

请参阅以下完整的教程:

答案 1 :(得分:0)

  

jmeter.JMeter:

     

未捕获的异常:java.lang.NoClassDefFoundError:   组织/ openqa /硒/ OS / Kernel32中

要修复上述错误,请在此处下载JNA jar及其依赖项:

http://www.java2s.com/Code/Jar/j/Downloadjna330platformjar.htm http://www.java2s.com/Code/Jar/j/Downloadjna330jar.htm

并将其放在lib文件夹中。