eclipse - Error instantiating class:class:null java.lang.reflect.InvocationTargetException -
use selenium junit java + jmeter load testing.
in eclipse started test, ok, after make jar file , put in apache/lib/junit directory, starting jmeter choose jar file, , it's crashed error. reading lot of answer on stackoverflow , other siter, nothing find can me.
here's log:
2015/06/10 18:10:41 info  - jmeter.threads.jmeterthread: thread started: thread group 1-1  2015/06/10 18:10:49 error - jmeter.protocol.java.sampler.junitsampler: error instantiating class:class loadtestguppy.loadtestguppy.apptest:null java.lang.reflect.invocationtargetexception     @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method)   and code:
package loadtestguppy.loadtestguppy;  import org.junit.after; import org.junit.before; import org.junit.test; import org.openqa.selenium.by; import org.openqa.selenium.webdriver; import org.openqa.selenium.firefox.firefoxdriver;  import java.util.concurrent.timeunit;  import junit.framework.testcase;   public class apptest extends testcase {     private webdriver driver = new firefoxdriver();      public apptest(){}      public apptest(string text){         super(text);     }      @before     public void setup() throws exception {         driver.get("http://barracuda-qa.ko.kodak.com/d2l/faces/login.jsp");         driver.manage().window().maximize();     }      @test     public void testtestload() throws exception {         driver.findelement(by.id("loginform:authlogin")).sendkeys("some222");         driver.findelement(by.id("loginform:authpassword")).sendkeys("222");         driver.manage().timeouts().implicitlywait(60, timeunit.seconds);         driver.findelement(by.id("loginform:btnlogin")).click();         driver.manage().timeouts().implicitlywait(2000, timeunit.seconds);         driver.findelement(by.xpath("//a[@class='log']")).click();         driver.manage().timeouts().implicitlywait(2000, timeunit.seconds);         driver.findelement(by.xpath("//a[@class='logout']")).click();      }      @after     public void teardown() throws exception {         driver.close();     }  }   what can be?
try removing these line
invocationtargetexception checked exception wraps exception thrown invoked method or constructor
public apptest(){}          public apptest(string text){             super(text);         }   you can try reinstalling jar file see if works
Comments
Post a Comment