【问题标题】:How to replace selenium framework property file value from bamboo variable?如何从竹变量替换硒框架属性文件值?
【发布时间】:2021-03-28 04:29:17
【问题描述】:

我正在使用一个包含属性文件的 selenium 框架,并通过更改 URL 和端口等不同键值的值以及其中的所有值,使我能够灵活地进行测试,但是在与竹子集成时,我想使用竹变量来做到这一点,但到目前为止还没有运气。我在我的框架中使用了 ANT 和 testNG。

【问题讨论】:

    标签: selenium ant frameworks bamboo properties-file


    【解决方案1】:

    您可以将值传递给 ant:

    -DpropertyName=itsValue
    

    例如下面的项目,

    <project>
        <target name="selenium">
            <property name="url" value="."/>
            <echo message="URL value is ${url}"/>
        </target>
    </project>
    

    您可以将 URL 传递为

    ant -Durl="https://www.google.com" selenium
    

    打印出来

     [echo] URL value is https://www.google.com
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-03
      • 2011-07-13
      • 2018-04-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多