How can i run an appium testcase in console?

i can run testcases in eclipse, and i want to run it through console, i use this command
java -cp .:simpletest.jar:junit.jar org.junit.runner.JUnitCore com.imail.autotest.simpletest.SimpleTest

but only get an Exception Exception in thread “main” java.lang.NoClassDefFoundError: org/openqa/selenium/Capabilities
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at org.junit.runner.JUnitCore.runMain(JUnitCore.java:86)
at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:47)
at org.junit.runner.JUnitCore.main(JUnitCore.java:40)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.Capabilities
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

is there anyone can tell me how to make it? thanks a lot

go to command line cd …\yourjavaProject
try java -cp Lib*;bin com.imail.autotest.simpletest.SimpleTest
where bin , is your project bin
Lib\* - in , my case is a folder Lib where keep my external
jar file

1 Like