【问题标题】:In nightwatch, how do I specify additional string arguments after the selenium_port在守夜人中,如何在 selenium_port 之后指定其他字符串参数
【发布时间】:2019-12-03 09:22:26
【问题描述】:

在这里遇到了一个类似的问题,但没有真正解决 - https://github.com/nightwatchjs/nightwatch/issues/1911

你不能做@beatfactor建议的上面例子,端口在中间,即“selenium_host”:“us1.appium.testobject.com:443/wd/hub”,

我现在面临着类似的问题,我如何提供参数以便它尝试像上面那样访问主机?目前,我的失败选项是不提供默认为 4444 的端口或提供导致尝试访问 us1.appium.testobject.com/wd/hub:443 的端口

想要的结果是: “selenium_host”:“us1.appium.testobject.com:443/wd/hub”,

TLDR - 你如何在 selenium 主机参数的中间提供一个端口,因为端口总是附加到末尾,如果你不提供,则使用默认值?

【问题讨论】:

    标签: nightwatch.js saucelabs


    【解决方案1】:

    只需在声明部分定义您的selenium_port 上游并使用Template Literal

    const selenium_port = '443';
    
    "test_settings" : {
      "default" : {
      "launch_url" : "http://test.com",
      "selenium_port" : selenium_port 
      "selenium_host" : `us1.appium.testobject.com:${selenium_port}/wd/hub`,
      "silent" : true,
      "screenshots" : {
      "enabled" : true,
      "path" : "screenshots"
      }
    },
    

    希望我理解正确。干杯!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-02
      • 1970-01-01
      • 2022-01-21
      • 2012-10-18
      • 1970-01-01
      • 2019-03-17
      • 2019-08-19
      相关资源
      最近更新 更多