0
votes

I am trying to run test Suite generated using Selenium ide in firefox through command line in windows OS.

i have created test case and exported as tcjr.java i have created test suite and exported as tsjs.java

now when i compile test case with:

D:\selenium>javac -classpath D:\selenium\selenium-server-standalone-2.40.0.jar D:\selenium\tcjr.java

it is compiling and generating tcjr.class now.. when i compile tsjr with the same command it is showing error:

D:\selenium\tsjr.java:4: error: class Tsjr is public, should be declared in a fi
le named Tsjr.java
public class Tsjr {
       ^
D:\selenium\tsjr.java:8: error: cannot find symbol
                suite.addTestSuite(tcjr.class);
                                   ^
  symbol:   class tcjr
  location: class Tsjr
2 errors

Please help me in solving this... i am stuck.

3

3 Answers

0
votes

You need to keep the file name and class name same. Only then it will compile. See the first error it shouts that you need to declare Tsjr in Tsjr.java file as oppose to tsjr.java file.

0
votes

You need to add reference to all the jar file of whose functionality you want to use in your code. In above case I think you are missing junit reference in classpath.

0
votes

Keep java file name and class name same as tcjr.java

public class tcjr {
/*your code here*/
}