0

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

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

Selenium 网格服务器:

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

这没有用。我怎么让它工作?

4

2 回答 2

1

您使用过: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 之后)。

于 2015-04-30T14:32:48.997 回答
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:如何在 Windows 上安装/设置和使用 cURL?

于 2015-02-23T16:15:18.210 回答