如何使用TestNG以编程方式运行Selenium Java测试? [英] How to run Selenium Java tests with TestNG programmatically?

查看:192
本文介绍了如何使用TestNG以编程方式运行Selenium Java测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Selenium RC与Java使用TestNG作为测试框架。我使用Eclipse作为IDE。我想从我自己的程序很容易地调用TestNG。如何做到这一点?

解决方案

TheStijn给出了一些很好的方向,尽管TestMethodWorker()是内部的,所以你不应该使用



根据这个问题,我甚至不确定原来的海报是否尝试在一个单独的过程中启动TestNG,所以API文档可能是你'重新寻找:



http://testng.org/doc/documentation-main.html#running-testng-programmatically


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 gives a few good directions, although TestMethodWorker() is internal so you shouldn't use it.

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测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆