Skip to content

I cannot run my test using the EasyTest framework in my Project #64

@DeLaphante

Description

@DeLaphante

Can anyone help me??
I'm having a NoClassDefFoundError:org/slf4j/Loggerfactory issue when trying to build my test by adding @RunWith(DataDrivenTestRunner.class) at the beginning of my class.

My code is as follows:

import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.easetech.easytest.annotation.;
import org.easetech.easytest.runner.
;
import org.easetech.easytest.loader.*;

@RunWith(DataDrivenTestRunner.class)
@dataloader(filePaths = { "C:/Users/Christian/Documents/TestData.csv" }, loaderType = LoaderType.CSV)

public class Homepage {
static WebDriver driver ;

@Before
public void setUp() throws Exception{

 System.setProperty("webdriver.chrome.driver", "C:/Users/Christian/Documents/chromedriver_win32_2.0/chromedriver.exe");
    driver = new ChromeDriver();     

}

@Test
public final void testMethod1(@Param(name="Name")String name , @Param(name="Number")String number, @Param(name="Email")String email) throws Exception
{
     driver.get("http:\\www.google.com");
    driver.findElement(By.linkText("Search")).click();

    driver.findElement(By.xpath("//*[@id='wpcf7-f220-t1-o1']/form/p/span[1]/input")).sendKeys(name);

    driver.findElement(By.xpath("//*[@id='wpcf7-f220-t1-o1']/form/p/span[2]/input")).sendKeys(number);

    driver.findElement(By.xpath("//*[@id='wpcf7-f220-t1-o1']/form/p/span[3]/input")).sendKeys(email);

    driver.findElement(By.xpath("//*[@id='wpcf7-f220-t1-o1']/form/p/input")).click();
}

@Test
public void testMethod2() throws Exception{

    driver.get("http:\\www.testhouse.net");


    driver.findElement(By.linkText("Test Tools")).click();

}

@After
public void tearDown(){
    driver.quit();
}

}

The trace log is a follows:

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.easetech.easytest.runner.DataDrivenTestRunner.(DataDrivenTestRunner.java:85)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:26)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.(JUnit4TestReference.java:33)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestClassReference.(JUnit4TestClassReference.java:25)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:48)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 19 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions