简体   繁体   中英

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? :

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.

test文件夹中的类在构建后不包含在应用程序中,因此如果您想从主类运行PageTest ,请确保您的PageTest类不在test文件夹中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM