TestNG Eclipse插件

TestNG Eclipse plugin helps us in creating TestNG classes easily and executing them. Let’s see how to install “TestNG for Eclipse” plugin in Eclipse IDE.

TestNG Eclipse插件帮助我们轻松创建TestNG类并执行它们。 让我们看看如何在Eclipse IDE中安装“ TestNG for Eclipse”插件。

TestNG Eclipse插件 (TestNG Eclipse Plugin)

  1. Open Eclipse and go to Help | Eclipse Marketplace. Then search for “TestNG”. You should get following result.帮助| Eclipse市场 。 然后搜索“ TestNG”。 您应该得到以下结果。
  2. Click on Install and next window will show TestNG features to install. Select all of them and click on Continue button.
  3. In the next screen, accept the license agreement and click on Finish button.
  4. Eclipse will show the warning that you are installing software that contains unsigned content. Click on “Install Anway” button.
  5. After installation is finished, Eclipse will ask you to restart so that TestNG Eclipse plugin is available to use. Click on “Restart Now” to restart Eclipse and start using the TestNG plugin.
    eclipse restart for testng plugin

    安装完成后,Eclipse将要求您重新启动,以便可以使用TestNG Eclipse插件。 单击“立即重新启动”以重新启动Eclipse并开始使用TestNG插件。

用于Eclipse安装验证的TestNG (TestNG for Eclipse Installation Verification)

After Eclipse is restarted, go to New | Other. The wizard window will open up and you should see option to create a TestNG class.

重新启动Eclipse之后,转到New | 其他 。 向导窗口将打开,您将看到创建TestNG类的选项。

If you get above option, then it means that TestNG Eclipse plugin has been installed successfully.

如果您获得上述选项,则表明TestNG Eclipse插件已成功安装。

TestNG Eclipse教程 (TestNG Eclipse Tutorial)

You can go through TestNG Tutorial to learn how to create TestNG tests using TestNG for Eclipse plugin.

您可以通过TestNG教程来学习如何使用TestNG for Eclipse插件创建TestNG测试。

TestNG Eclipse运行配置 (TestNG Eclipse Run Configuration)

We can create TestNG classes run configuration so that we don’t have to find the test class and run it as TestNG test.

我们可以创建TestNG类运行配置,这样我们就不必找到测试类并将其作为TestNG测试运行。

Let’s see how easily we can create an Eclipse TestNG Run Configuration.

让我们看看我们如何轻松地创建Eclipse TestNG运行配置。

Open the TestNG test class and go to Run As | Run Configurations.

打开TestNG测试类并转到“运行方式| 运行配置

Click on the + button as shown in the below image.

单击+按钮,如下图所示。

In the configuration screen, provide a descriptive name for the configuration. Browse for the project and select the class as shown in the below image.

在配置屏幕中,为配置提供一个描述性名称。 浏览项目,然后选择类,如下图所示。

Click on “Apply” button to save the configuration. You can then click on “Run” button to run the configuration, which will run the TestNG test class.

单击“应用”按钮以保存配置。 然后,您可以单击“运行”按钮运行配置,这将运行TestNG测试类。

You can go to Run | Run Configurations and select the predefined configuration to run the TestNG test class.

您可以转到运行| 运行配置并选择预定义的配置以运行TestNG测试类。

That’s all for a quick tutorial on using Eclipse TestNG plugin.

这就是有关使用Eclipse TestNG插件的快速教程的全部内容。

翻译自: https://www.journaldev.com/21265/testng-eclipse-plugin

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值