使用IntelliJ和TestNG测试并行性 [英] Test parallelism with IntelliJ and TestNG

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

问题描述

我正在尝试并行运行一些TestNG测试,但由于IntelliJ在运行中构建它,因此无法访问testng.xml。我已经尝试在运行配置中添加诸如'parallel = methods'之类的参数,但这似乎没有任何区别。

I'm attempting to run some TestNG tests in parallel but don't have access to a testng.xml as IntelliJ builds it on the fly. I've tried adding parameters such as 'parallel=methods' to the run configuration but this doesn't appear to be making any difference.

如何让TestNG运行从IntelliJ并行而不需要构建我自己的testng.xml文件?

How can I make TestNG run in parallel from IntelliJ without resorting to having to build my own testng.xml file?

推荐答案

你无法设置它注释。它必须在XML中配置。您需要设置XML模板。在eclipse中它将是windows - > preferences - > testNG Template XML File。

You can't set this up with annotations. It must be configured in the XML. You need to set up an XML template. In eclipse it would be windows -> preferences -> testNG Template XML File.

使用包含所有并行和常用选项的XML文件,当您作为testNG运行时,它将仅替换该部分,同时保持其他设置。

Use an XML file that has all your parallel and usual optins and when you run as testNG it will replace only the section, while maintaining your other settings.

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

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