将一个参数引用到 testng.xml 文件中的另一个参数 [英] Refering a Parameter to another Parameter in testng.xml file

查看:28
本文介绍了将一个参数引用到 testng.xml 文件中的另一个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 testng.xml 中有以下内容

I have the following in testng.xml

...
<parameter name="Empl_Name" value="Stephen" />
<test name="Employee Search test" junit="false">
    <parameter name="Valid_Empl_Name" value="${Empl_Name}" />
    <classes> 
          <class name="org.EmployeeClass" />
    </classes> 
</test>

以上方法无效.我的要求是我想用上面提到的 Empl_Name 引用参数 Valid_Empl_Name.我想在许多测试用例中重用 Empl_Name 参数值.

The above is not working. My requirement is that I want to refer the Parameter Valid_Empl_Name with the above mentioned Empl_Name. I want to reuse the Empl_Name parameter value in many of the test cases.

有没有办法做到这一点?

Is there any way to do this ?

推荐答案

TestNG 目前不支持此功能,但我愿意添加它.

This is currently not supported in TestNG but I'd be open to adding it.

这篇关于将一个参数引用到 testng.xml 文件中的另一个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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