2017-05-29 18 views
1

こんにちは、 jmeterでjunitの負荷テストを行っています。この目的のために、私はセレンのwebdriverをとり、セレンのjunitテストでそれを実行しています。セレンのwebdriverでjunitを使ってこのコードを実行すると、正常に動作します。しかし、jmeterで20スレッドで同じことをしようとすると、次の問題に直面しています。jmeterのjunitリクエストサンプラー待ち状態が動作しない

Error -- test(org.apache.jmeter.protocol.java.sampler.JUnitSampler$AnnotatedTestCase): org.openqa.selenium.support.ui.WebDriverWait.until(Ljava/util/function/Function;)Ljava/lang/Object; 
Trace -- java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Ljava/util/function/Function;)Ljava/lang/Object; 
    at SeleniumTestNG.LoginLogoutTest.test(LoginLogoutTest.java:55) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.apache.jmeter.protocol.java.sampler.JUnitSampler$AnnotatedTestCase.runTest(JUnitSampler.java:593) 
    at org.apache.jmeter.protocol.java.sampler.JUnitSampler$1.protect(JUnitSampler.java:673) 
    at junit.framework.TestResult.runProtected(TestResult.java:142) 
    at org.apache.jmeter.protocol.java.sampler.JUnitSampler.sample(JUnitSampler.java:395) 
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491) 
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425) 
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) 
    at java.lang.Thread.run(Unknown Source) 
Error -- test(org.apache.jmeter.protocol.java.sampler.JUnitSampler$AnnotatedTestCase): org.openqa.selenium.support.ui.WebDriverWait.until(Ljava/util/function/Function;)Ljava/lang/Object; 
Trace -- java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Ljava/util/function/Function;)Ljava/lang/Object; 
    at SeleniumTestNG.LoginLogoutTest.tearDown(LoginLogoutTest.java:83) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    at java.lang.reflect.Method.invoke(Unknown Source) 
    at org.apache.jmeter.protocol.java.sampler.JUnitSampler.sample(JUnitSampler.java:399) 
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:491) 
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:425) 
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:254) 
    at java.lang.Thread.run(Unknown Source) 

この問題で私を助けてください。

+0

NoSuchMethodErrorを修正するにはどうすればいいですか?(https://stackoverflow.com/questions/35186/how-do-i-fix-a-nosuchmethoderror) – crizzis

答えて

0

this issueまたは派生しているように、スタンドアロンJUnitプロジェクトのすべてのライブラリをJMeter Classpathに入れてください。

  • コードを、あなたのプロジェクトの
  • 依存ライブラリあなたのJMeterのインストールの「LIB」フォルダ
  • 内容を実行しようとしている。今後

    は、あなたの質問が含まれていることを確認してくださいjmeter.logファイル

012経由で利用可能なWebDriver SamplerもありますJMeterとSeleniumの統合を提供するプロジェクトでは、モジュールを再コンパイルしたり、JMeterの "lib/junit"フォルダにJarファイルをコピーしたり、JMeterを再起動したりする必要がなくなるので、開発がはるかに高速になります。

関連する問題