【问题标题】:Canoo / Ant properties scoping differently in tasks and steps?Canoo / Ant 属性在任务和步骤中的范围不同?
【发布时间】:2011-07-26 00:28:36
【问题描述】:

我们设置了 Canoo webtest 来测试多语言环境应用程序。对于每个语言环境,webtest 会从属性文件中加载一些属性。

在下面的示例中,locale_code、htaccess.username、htaccess.password 和 webtest_url 都定义在这样一个属性文件中。

在webtest任务本身中,${locale_code}被替换,导致(例如) "CatalogueOrderFriendsCountry DE-DE http://www.example.com"。

但是,调用步骤中的属性没有被替换,描述显示为“Einstieg Hauptseite ${webtest_url}”即使它们被正确替换为仅在其上方的一行

<project default="test">
  <import file="../../definitions.xml"/>
  <target name="test" depends="wt.defineMacros">
    <webtest name="CatalogueOrderFriendsCountry ${locale_code} ${webtest_url}">

      <invoke username="${htaccess.username}" password="${htaccess.password}" url="${webtest_url}" description="Einstieg Hauptseite ${webtest_url}"/>
      ...

很明显,特定语言环境的属性文件已加载,我们可以更改文件中的 webtest_url(例如),并在 webtest 名称中正确替换新值。

我对 ant 几乎一无所知(Canoo 是我接触过的),对 Canoo webtest 知之甚少(我最近继承了它们),所以我什至不确定这是 webtest 还是 ant 问题。

【问题讨论】:

    标签: ant properties canoo


    【解决方案1】:

    您可能正在使用 Ant 1.8
    不评估动态属性。
    您必须使用 Ant 1.7

    见问题Dynamic property resolution does not work with Ant 1.8 or later
    Canoo Webtest Mailing List

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-17
      • 1970-01-01
      • 2017-04-28
      • 1970-01-01
      相关资源
      最近更新 更多