繁体   English   中英

如何在每个运行在不同线程中的多个testng xml文件之间传递值

[英]How to pass values between multiple testng xml files each running in different threads

在硒中,我正在使用ThreadLocal概念并行执行多个xml文件。 现在,我想在线程之间进行通信:

  1. 传递xml1中的TestA。
  2. 传递xml1中的TestA时,应执行xml2中的TestA。 在那之前,我需要等待xml2的线程。

我尝试使用依赖项,但是它只能在xml文件中显示。

请注意,我正在一个产品中工作,该产品具有包含近10k测试用例的不同模块。 当前的ThreadLocal概念需要一整天才能完成运行。

我想最小化执行时间。 请说明任何想法。

我不确定它是否适合您的情况,但是您可以在测试中使用组, you can specify your group dependencies in the testng.xml file(s).

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Test Suite for End To End">
    <test name="AUT_E2E_01">
        <parameter name="browser" value="Chrome" />
        <classes>
            <class name="com.myunit.regressiontests">
                <methods>
                    <include name="Test1" />
                    <include name="Test11" dependsOnMethods="SomeMethod" />
                </methods>
            </class>
        </classes>
        <groups>
            <dependencies>
                <group name="SomeOther-Group" depends-on="Some-Group" />
            </dependencies>
        </groups>
    </test>
</suite>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM