[英]How to execute Selenium Webdriver test as TestNG in eclipse
I'm using Selenium WebDriver with Java and TestNG as Test framework. 我正在将Selenium WebDriver与Java和TestNG用作测试框架。 I'm using Eclipse (eclipse-jee-indigo-SR2-win32) as IDE.
我正在使用Eclipse(eclipse-jee-indigo-SR2-win32)作为IDE。 I want to execute my test (java file) in eclipse as TestNG test.
我想在Eclipse中执行我的测试(java文件)作为TestNG测试。
For example, I have Registration.java and I want to run within eclipse as TestNG test. 例如,我有Registration.java,我想在Eclipse中运行TestNG测试。 For running this file I did the following steps:
为了运行此文件,我执行了以下步骤:
But I didn't find any option of TestNG to run my test. 但是我找不到TestNG的任何选项来运行测试。 What should be done in eclipse for this?
在月食中应该做什么呢?
It needs to install TestNG plug-in for Eclipse. 它需要安装Eclipse的TestNG插件。 To do this follow the steps below:
为此,请按照以下步骤操作:
[Note: Right click on Registration.java -> Mouse over Run As -> Click TestNG Test. [注意:右键单击Registration.java->将鼠标悬停在Run As->单击TestNG Test。 Your test Registration would be executed]
您的测试注册将被执行]
Is it just this file that you can't run as a TestNG test or anything, ie have you configured Eclipse for TestNG at all yet? 仅仅是不能作为TestNG测试运行的文件还是什么,即您是否已经为TestNG配置了Eclipse? If not the first place to look is here http://testng.org/doc/eclipse.html
如果不是第一眼的地方,请访问http://testng.org/doc/eclipse.html
Please follow Koly answers. 请遵循Koly的答案。 That is correct one!
那是正确的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.