Use Selenium JUnit Java + JMeter for Load testing.
In Eclipse started the test, everything is ok, after make a JAR file and put it in apache/lib/junit directory, starting JMeter choose this JAR file, and it's crashed with error. I was reading a lot of answer on stackoverflow and other siter, but nothing find that can help 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
at 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 it can be?
Try removing these line
InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor
You can try reinstalling the jar file see if that works