java -jar selenium-server-standalone.jar -role hub
参数说明:
{
"host": null,
"port": 4444,
"newSessionWaitTimeout": -1,
"servlets" : [],
"prioritizer": null,
"capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 5000,
"cleanUpCycle": 5000,
"timeout": 300000,
"browserTimeout": 0,
"maxSession": 5
}
java -jar selenium-server-standalone.jar -role wd -hub http://localhost:4444/grid/register
java -jar selenium-server-standalone.jar -role rc -hub http://localhost:4444/grid/register
java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444/grid/register
参数说明:
{
"capabilities":
[
{
"browserName": "*firefox",
"maxInstances": 5,
"seleniumProtocol": "Selenium"
},
{
"browserName": "*googlechrome",
"maxInstances": 5,
"seleniumProtocol": "Selenium"
},
{
"browserName": "*iexplore",
"maxInstances": 1,
"seleniumProtocol": "Selenium"
},
{
"browserName": "firefox",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "chrome",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
},
{
"browserName": "internet explorer",
"maxInstances": 1,
"seleniumProtocol": "WebDriver"
}
],
"configuration":
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 5,
"port": 5555,
"host": ip,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": ip
}
}
browserName=firefox
version=3.6
platform=LINUX
maxInstances=5
firefox_binary=/home/myhomedir/firefox36/firefox
chrome_binary="C:\program file\chrome\chrome.exe"
注:
在node方式启动的命令中,除了上面列出的选项外,还可以附加独立RC方式启动时所支持的选项;因为以node方式启动时,除了可以和hub通信外,还包含了独立RC服务器的所有功能。