gpt4 book ai didi

java - 通过 TestNG 使用 Selenium 执行自动化测试时出现 "TestNG No tests found. Nothing was run"

转载 作者:行者123 更新时间:2023-12-01 19:59:18 25 4
gpt4 key购买 nike

image

我想知道在运行自动化项目之前应该安装哪些软件。 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更改@BeforeTest注释并执行测试用例/测试套件

关于java - 通过 TestNG 使用 Selenium 执行自动化测试时出现 "TestNG No tests found. Nothing was run",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59014394/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com