[英]How to make acces to src.test package from main class in Java or how to run test class from main class?
I try to launch selenium
test from main class and try to follow the example from next question: How do I run JUnit tests from inside my java application?我尝试从主类启动selenium
测试并尝试遵循下一个问题中的示例: 如何从我的 Java 应用程序内部运行 JUnit 测试? : :
JUnitCore junit = new JUnitCore();
Result result = junit.run(testClasses);
But I cannot use this resolve because I have not access to my test class from main class:但是我无法使用此解析,因为我无法从主类访问我的测试类:
Queation: How to correctly run test class from main class?问题:如何从主类正确运行测试类?
PS聚苯乙烯
I need to run test class from main class since is necessary build executable jar
file and launched the selenium
test from it.我需要从主类运行测试类,因为有必要构建可执行jar
文件并从中启动selenium
测试。
test
文件夹中的类在构建后不包含在应用程序中,因此如果您想从主类运行PageTest
,请确保您的PageTest
类不在test
文件夹中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.