首页 > 解决方案 > 为什么 selenium 测试用例在 windows cmd 中运行 testng.xml 时被随机跳过

问题描述

我尝试使用带有多个案例的 testng.xml 文件运行 selenium 自动化测试案例,但有些案例被跳过了。TestNG 也不显示跳过的测试用例计数,但显示总计数和失败计数。找不到原因并解决此问题。

因此,我需要使用 testng.xml 运行 tescases 的解决方案,而无需使用 cmd 行中的以下命令跳过 windows cmd;

    java org.testng.TestNG %project_location%\sample_testng.xml

你能请任何人帮助我解决这个问题吗?

在此处输入图像描述

标签: javaseleniumtestingautomated-teststestng.xml

解决方案


你的测试没有被跳过。他们成功了。

Tests run: 19 = Total test count.
Failures: 15 = Failed tests.
Skips: 0 = Skipped tests.
Total test count - Failed tests - Skipped tests = Successful tests.

19 - 15 - 0 = 4 次成功测试


推荐阅读