如何使用Eclipse并行运行TestNG测试? [英] How to run TestNG tests in parallel using Eclipse?

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

问题描述

我是test-ng的新手,我使用eclipse插件来运行测试用例。
我有一个用于数据的Excel文件。当我在运行时,它是由1执行的。我知道我们可以通过设置 parallel = methods thread-count =通过 cmd 并行执行 2 ,但是在Eclipse插件中不起作用。因此,请告诉我如何在Eclipse中并行运行TestNG。

I am new to test-ng, I am using eclipse plugin to run test cases. I have an excel file for data. when I am running, it is executing 1 by 1. I know we can execute parallel through cmd by setting parallel="methods" thread-count="2", But it not working in Eclipse plugin. So please tell me how to run TestNG parallel in Eclipse.

谢谢。

推荐答案

这似乎是确切的问题及其答案:

It seems here is the exact question and the answer to it:


在运行XML文件时,您可以指定您要为此执行的所有设置都在XML文件中运行,但是如果要使用特定的侦听器以并行方式运行程序包怎么办?如何为不是从XML文件完成的所有启动配置配置?

When you are running an XML file, you can specify all the settings you want for this run in the XML file, but what if you want to run a package in parallel mode with specific listeners? How can you configure the settings for all the launches that are not done from an XML file?

为了让您获得最大的灵活性,TestNG允许您指定一个所有这些启动的XML套件文件,都可以在首选项菜单中找到:屏幕截图

In order to give you access to the most flexibility, TestNG lets you specify an XML suite file for all these launches, which you can find in the Preferences menu: screenshot.

如果您将有效的套件文件指定为 XML模板文件,则TestNG将重用此XML文件中找到的所有设置,例如并行,名称,侦听器,线程池大小等...该文件中的< test> 标记将被忽略,因为插件会将它们替换为生成的< test> 标记,代表您选择的启动。

If you specify a valid suite file as "XML template file", TestNG will reuse all the settings found in this XML file, such as parallel, name, listeners, thread pool size, etc... Only the <test> tags in this file will be ignored since the plug-in will replace these by a generated <test> tag that represents the launch you chose.

- TestNG-Eclipse

总之,必须要有套件XML文件。

Long story short, it is necessary to have the suite XML file.

另外,请参阅套件XML文件架构相应部分的文档: TestNG:5.10-并行性和超时

Also, please see the documentation on the appropriate part of the suite XML file schema: TestNG: 5.10 - Parallelism and time-outs.

这篇关于如何使用Eclipse并行运行TestNG测试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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