0

I have test class created by framework

import org.selenium.MainTestCase;

public class Test01 extends MainTestCase {

  @Override
  public void setUp() throws Exception {
    super.setUp();
    startSeleniumSession("RemoteWebDriver", "http://102.0.0.01:8080/hello/");
  }

  public void testMethod() throws Exception {

        session().open("/hello/request.co","");
        session().selectFrame("top_frame");
        session().type("id=lgn:username","test");
        session().type("id=lgn:password","test");
        session().click("id=lgn:submit");
        session().waitForFrameToLoad("top_frame","");
  }

  @Override
  public void tearDown() throws Exception {
    super.tearDown();
  }

}

And I have bat file

javac -cp .\lib\* Test01.java
java -cp .\lib\* org.junit.runner.JUnitCore Test01

In lib folder I have all jars and framework which generated Test01 class for me.

When I run my bat file I got result:

JUnit version 4.10 Coul not find class: Test01 Time: 0,002 OK(0 tests)

Structure of classes and libs is:

Root folder - dist

lib folder(under dist) - where all my libs placed

In dist folder I have Test01.class and Test01.java and run.bat

java_user
  • 929
  • 4
  • 16
  • 39

1 Answers1

2

You need to add your current directory to the classpath with a .. On windows-based systems you separate folders with a ; while on a unix-based systems you separate with a :.

Windows Example : my/path/1;. (Adds path my/path/1 and the current directory)

Unix example: my/path/1:. (Adds path my/path/1 and the current directory)

fdsa
  • 1,379
  • 1
  • 12
  • 27