2015-02-06 87 views
0

在Selenium GRID上將android設置爲節點仍然是最後一部分,將.json配置文件添加到selendroid .bat文件中讓我感到困惑。我已經嘗試了幾種方式,但仍然沒有按預期做出反應。這些都是.bat文件: Selendorid:在Selenium GRID上的Selendroid上爲android設置節點

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

硒網格服務器:

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 

哪沒有工作。我如何得到它的工作?

回答

1

使用cUrl將Selendroid節點註冊到WebDriver網格HUB。

我用這個內容(在Windows上)一個bat文件:

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的問題,使用捲曲:How do I install/set up and use cURL on Windows?

1

您已經使用: Java的罐子selendroid-獨立-0.13.0與 - dependencies.jar -app selendroid-test-app-0.14.0.apk -port 5555 -role node nodeconfig:nodeconfig.json

嘗試將「:」更改爲:「 - 」(在nodeconfig之後)。

相關問題