How to run Selenium Java tests with TestNG programmatically?(如何以编程方式使用 TestNG 运行 Selenium Java 测试?)
问题描述
我正在使用 Selenium RC 和 Java,使用 TestNG 作为测试框架.我使用 Eclipse 作为 IDE.我想很容易地从我自己的程序中调用 TestNG.我该怎么做?
I am using Selenium RC with Java using TestNG as Test Framework. I'm using Eclipse as IDE. I want to invoke TestNG from my own program very easily. How can I do that?
推荐答案
TheStijn 给出了一些好的方向,虽然 TestMethodWorker() 是内部的,所以你不应该使用它.
TheStijn gives a few good directions, although TestMethodWorker() is internal so you shouldn't use it.
基于这个问题,我什至不确定原始发帖人是否试图在单独的进程中启动 TestNG,因此 API 文档可能是您正在寻找的:
Based on the question, I'm not even sure the original poster is trying to launch TestNG in a separate process, so the API documentation might be what you're looking for:
http://testng.org/doc/documentation-main.html#running-testng-programmatically
这篇关于如何以编程方式使用 TestNG 运行 Selenium Java 测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何以编程方式使用 TestNG 运行 Selenium Java 测试?


基础教程推荐
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 降序排序:Java Map 2022-01-01