简体   繁体   English

如何从命令行运行测试? (IntelliJ Idea + Java + TestNG)

[英]How to run tests from the command line ? (IntelliJ Idea + Java +TestNG)

I'm kind of new to Java and IntelliJ Environments 我是Java和IntelliJ环境的新手

I managed to create a simple TestNG test inside IntelliJ (Only contains one assertion) and run it. 我设法在IntelliJ中创建一个简单的TestNG测试(只包含一个断言)并运行它。

What are the ordered steps that I need to do in order to be able to run from the command line 为了能够从命令行运行,我需要执行哪些有序步骤

I tried different approaches and nothing worked so far 我尝试了不同的方法,迄今为止没有任何工作

Eventually I would like to run selenium but by now I'm OK with only running that simple assertion... 最终我想运行selenium但是现在我只能运行那个简单的断言...

From the official docs at http://testng.org/doc/documentation-main.html#running-testng 来自http://testng.org/doc/documentation-main.html#running-testng上的官方文档

Assuming that you have TestNG in your class path, the simplest way to invoke TestNG is as follows: 假设您的类路径中有TestNG,调用TestNG的最简单方法如下:

java org.testng.TestNG testng1.xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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