問題描述
我正在使用 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 測試?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!