TestNG中文文档(04) -- 运行TestNG

一、运行TestNG

TestNG可以使用多种方式调用:

  • 命令行
  • ant
  • Eclipse
  • IntelliJ's IDEA

本节将只介绍如何从命令行运行TestNG。如果您对其他方式感兴趣,那么就点击上面的链接查看更多信息。

假设TestNG已经在你的类路径中,最简单的调用方式如下

java org.testng.TestNG testng1.xml [testng2.xml testng3.xml ...]

你至少要指定一个XML文件,它描述了你要运行的TestNG suite。此外,还有如下命令行参数:

选项 参数 说明
-d 目录 报告会生成的目录 (默认是test-output).
-excludegroups 逗号分隔的组列表

你可能感兴趣的:(TestNG)