【问题标题】:Setup Node for android on Selendroid on Selenium GRID在 Selenium GRID 上的 Selendroid 上为 android 设置节点
【发布时间】:2015-02-06 14:27:40
【问题描述】:

将 android 设置为 Selenium GRID 上的节点仍然是最后一部分,通过将 .json 配置文件添加到 selendroid .bat 文件让我感到困惑。我已经尝试了多种方式,但仍然没有按预期响应转储。这些是 .bat 文件: Selendorid:

java -jar selendroid-standalone-0.13.0-with-dependencies.jar -app selendroid-test-app-0.14.0.apk -port 5555

Selenium GRID 服务器:

java -Dfile.encoding=UTF-8 -cp "selendroid-grid-plugin-0.14.0.jar;selenium-server-standalone-2.44.0.jar" org.openqa.grid.selenium.GridLauncher -capabilityMatcher io.selendroid.grid.SelendroidCapabilityMatcher -role hub -host 127.0.0.1 -port 4444

nodeconfig.json 文件:

{
  "capabilities": [{
      "browserName": "selendroid",
      "maxInstances": 1,
      "aut": "io.selendroid.testapp:0.14.0"
  }, {
      "browserName": "android",
      "maxInstances": 1
  }],
  "configuration": {
      "maxSession": 1,
      "register": true,
      "hubHost": "localhost",
      "hubPort": 4444,
      "remoteHost": "http://localhost:5555",
      "proxy": "io.selendroid.grid.SelendroidSessionProxy"
  }
}

如何将 nodeconfig.json 添加到 selendroid 以使其工作?我试过这样:

java -jar selendroid-standalone-0.13.0-with-dependencies.jar -app selendroid-test-app-0.14.0.apk -port 5555 -role node nodeconfig: nodeconfig.json

这不起作用。我如何让它工作?

【问题讨论】:

    标签: android json batch-file selendroid selenium-grid2


    【解决方案1】:

    使用 cUrl 将 Selendroid 节点注册到 WebDriver 网格 HUB。

    我使用包含此内容的 bat 文件(在 Windows 上):

    REM - Register a Selendroid WebDriver node to the Hub using CURL
    "C:\opt\grid\curl-7.40.0\curl.exe" -H "Content-Type: application/json" -X POST --data @selendroid-node-config.json http://{IP-of-your-Grid-Hub}:4444/grid/register
    

    在 Nodeconfig.json 中指定 selendroid 功能。

    如果您使用的是 Windows 计算机,则可以通过 StackOverflow 问题下载和使用 cUrl:How do I install/set up and use cURL on Windows?

    【讨论】:

      【解决方案2】:

      您使用过: java -jar selendroid-standalone-0.13.0-with-dependencies.jar -app selendroid-test-app-0.14.0.apk -port 5555 -role node nodeconfig: nodeconfig.json

      尝试将“:”更改为:“--”(在 nodeconfig 之后)。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-04-24
        • 2011-10-16
        • 2016-11-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多