0

我无法在我的 Eclipse IDE 中运行测试用例。当我运行一个或多个测试用例时,我收到以下消息。谁能告诉我解决方案?

 [RemoteTestNG] detected TestNG version 6.8.9
    [RemoteTestNG] Invoked with -serport 57601 -protocol json -d F:\encoreworks\maininterface\test-output C:\Users\Admin\AppData\Local\Temp\testng-eclipse--1595370957\testng-customsuite.xml 
    [BaseMessageSender] Waiting for Eclipse client on localhost:57601
    [BaseMessageSender] Received a connection from Eclipse on localhost:57601
    [BaseMessageSender] Connection established, starting reader thread
    [BaseMessageSender] ReaderThread waiting for an admin message
    [JsonMessageSender] Sending message [GenericMessage suiteCount:1 testCount:1]
    [BaseMessageSender] ReaderThread received admin message:>ACK
    [BaseMessageSender] Received ACK:>ACK
    [BaseMessageSender] Received ACK:>ACK
    [TestNG] Running:
      C:\Users\Admin\AppData\Local\Temp\testng-eclipse--1595370957\testng-customsuite.xml

    [JsonMessageSender] Sending message [SuiteMessage suite:Default suite starting methodCount:0]
    [JsonMessageSender] Sending message [TestMessage suite:Default suite testName:Default test passed:0 failed:0]
    [BaseMessageSender] Received ACK:>ACK
    [BaseMessageSender] Received ACK:>ACK
    [BaseMessageSender] Received ACK:>ACK
    [BaseMessageSender] Received ACK:>ACK
    [JsonMessageSender] Sending message [TestMessage suite:Default suite testName:Default test passed:0 failed:0]
    [BaseMessageSender] Received ACK:>ACK
    [BaseMessageSender] Received ACK:>ACK
    [JsonMessageSender] Sending message [SuiteMessage suite:Default suite ending methodCount:0]

    ===============================================
    Default suite
    Total tests run: 0, Failures: 0, Skips: 0
    ===============================================

    [BaseMessageSender] Received ACK:>ACK
    [BaseMessageSender] Received ACK:>ACK
4

2 回答 2

1

我面临着类似的问题。升级testng,eclipse,没有任何帮助。最后我可以解决这个问题。下面给出了对我有用的解决方案:
Maven 中提到的 Testng 版本:6.8.7
Eclipse TestNG 插件版本:6.11
Eclipse 版本:Neon.3 Release (4.6.3)

转到 Eclipse > Project Explorer > 右键单击​​项目名称 > 转到构建路径 > 配置构建路径 > 项目属性窗口打开 > 搜索 testng > 展开 testng > 出现 Maven 选项 > 单击 Maven > 取消选中“属性(TestNG CLI 参数)" 选项 > eclipse 设置截图> 应用

如果您使用的是 Eclipse LUNA 版本,请执行以下步骤:转到 Eclipse > Project Explorer > 右键单击​​项目名称 > 转到构建路径 > 配置构建路径 > 项目属性窗口打开 > 搜索并单击 testng > 启用项目特定的 testng 复选框

于 2018-08-24T12:03:49.197 回答
0

我有同样奇怪的问题,并通过编译项目并再次运行测试来解决它。

讲述整个故事:在我的 Maven 项目中,我删除了“目标”文件夹并尝试运行测试。它现在因“无法读取类上的方法......无法解析类引用......”而失败。

因此,通过使用“package”-goal 执行 Maven,我意识到我的 pom.xml 中存在故障(maven-compiler-plugin 中的目标版本不是 1.8)。修复此问题后,我的 Maven 构建运行没有问题。随着新目标折叠中的新类,TestNG 再次运行。

于 2016-09-19T13:46:52.233 回答