" TestNG未找到测试.一无所有"通过TestNG使用Selenium执行自动化测试时 [英] "TestNG No tests found. Nothing was run" while executing automated tests using Selenium through TestNG
问题描述
我想知道在运行自动化项目之前应该安装哪些确切的软件. Selenium Web驱动程序,Selenium Java,testNG,junit已安装,但与此同时也存在一些问题. 1. Selenium Java文件没有像人们在其视频教程中显示的那样具有更多JAR文件. 2.当我要以testNG运行项目时,eclipse表示Windows防火墙已阻止了该应用程序的某些功能.
此错误消息...
[TestNG] No tests found. Nothing was run
...表示 TestNG 未找到要执行的任何@Test
.
您的主要问题是,虽然您已将Test
导入为:
import org.testng.annotations.Test;
但是您的代码块本身没有@Test
,但包含@BeforeClass
.由于没有测试,因此TestNG找不到要执行的任何 Test .
解决方案
最简单的解决方案是使用 @Test
更改@BeforeTest
批注,然后执行测试用例/测试套件./p>
I want to know what exact software should I install before I run my automation project. Selenium web driver, selenium java, testNG, junit was installed but there are some problems with that also. 1. Selenium java file doesn't have more JAR files like people shows in their video tutorials. 2. When I' going to run my project as testNG, eclipse said windows firewall has blocked some features of this app.
This error message...
[TestNG] No tests found. Nothing was run
...implies that TestNG didn't find any @Test
to execute.
Your main issue is though you have imported Test
as:
import org.testng.annotations.Test;
But your code block has no @Test
as such but includes a @BeforeClass
. As there are no tests, TestNG doesn't find any Test to execute.
Solution
The easiest solution would be to change the @BeforeTest
annotation with @Test
and execute you Test case / Test Suite.
这篇关于" TestNG未找到测试.一无所有"通过TestNG使用Selenium执行自动化测试时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!