English 中文(简体)
将参数引向另一个参数,用于检测器、xml文档
原标题:Refering a Parameter to another Parameter in testng.xml file

我有以下试剂。

...
<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>

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.

是否有办法这样做?

最佳回答

这一点目前没有得到全国测验小组的支持,但我愿意予以补充。

问题回答

是的,它非常复杂,但有办法。 如果你用Maven建造项目,则有一个叫<条码>的Maven plugin-helper-maven-plugin。 这将使你在施工开始前先处理xml的档案。

在该项目中,我做了以下工作:





相关问题
Javascript communication with Selenium (RC)

My Application has a lot of calculation being done in JavaScript according to how and when the user acts on the application. The project prints out valuable information (through console calls) as to ...

Running automated Web browser tests under Hudson

I m running Hudson for my automated builds and love it. I d now like to create automated Web browser tests using either WaTiN (preferred) or Selenium. As my Hudson runs as a Windows service (under ...

Using a Java library with Scala reserved words

I m using an external library written in Java (Selenium). One of the function calls has the signature type(String, String), and I keep getting compiler errors when trying to call it from Scala, that ...

Heightened privilege selenium browsers on Windows 7 (x64)

I make use of *firefox and *iexplore etc. within my selenium tests to get around the issue of self-signed SSL certificates on my local machine. Unfortunately, now that I ve moved from XP over to 7, ...

Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Selenium IDE: Incrementing values by 1 and 71

Currently I m incrementing a value called wert by 1 with the following code: getEval storedVars[ wert ]=${wert}+1; The value wert is something like 80401299. I want to add 1 to the value, if it ...

热门标签