Selenium Grid Configuration

來源:互聯網
上載者:User

標籤:seleniu grid   webdriver grid   configuration   nodeconfig   

Selenium Grid Configuration

作者: Max.Bai

時間: 2014/06


1. Start Selenium Hub

java -jar selenium-server-standalone-2.<last_version>.jar-role hub

Can be check the hub status use http://127.0.0.1:4444/grid/console

2. Start Selenium Node

Start with Node contains Selenium RC and Webdriver

java -jar selenium-server-standalone-2.29.0.jar -role node -hub http://localhost:4444/grid/register

Start with Webdriver contains Webdriver

java -jar selenium-server-standalone-2.29.0.jar -role webdriver -hub http://localhost:4444/grid/register


Start with Selenium contains Selenium RC

java -jar selenium-server-standalone-2.29.0.jar -role selenium -hub http://localhost:4444/grid/register


3. Start Hub and Node with Json config

Start Hub with json config file

title HubWebDriverjava -jar selenium-server-standalone-2.29.0.jar-role hub-hubConfig hubconfig.jsonpause

hubconfig.json

{   "host": null,   "port": 4444,   "newSessionWaitTimeout": 300000,   "servlets" : [],   "prioritizer": null,   "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",   "throwOnCapabilityNotPresent": true,   "nodePolling": 5000,   "cleanUpCycle": 5000,   "nodeTimeout": 360000,   "timeout": 480000,   "browserTimeout": 0,   "maxSession": 5}

Start Node with json file

title NodeWebDriverjava -jar selenium-server-standalone-2.<last_version>.jar-Dwebdriver.ie.driver="ABSOLUTE_PATH\IEDriverServer.exe"-Dwebdriver.chrome.driver="ABSOLUTE_PATH\chromedriver.exe"-Dwebdriver.safari.bin="ABSOLUTE_PATH\Safari.exe"-Dwebdriver.opera.bin="ABSOLUTE_PATH\opera.exe"-Dwebdriver.chrome.bin="ABSOLUTE_PATH\chrome.exe"-Dwebdriver.ie.bin="ABSOLUTE_PATH\iexplore.exe"-role node-nodeConfig nodeconfig.jsonpause

nodeconfig.json

{   "capabilities":   [{"seleniumProtocol": "Selenium","platform": "MAC","browserName": "*iexplore","maxInstances": "1"},{"seleniumProtocol": "Selenium","platform": "MAC","browserName": "*firefox","maxInstances": "5","firefox_binary":"c:\sss\firefox.exe"},  { "seleniumProtocol":"Selenium", "browserName":"*firefox", "maxInstances":1  },  { "seleniumProtocol":"WebDriver", "browserName":"firefox", "maxInstances":1, "firefox_binary":"c:\sss\firefox.exe"  },  { "seleniumProtocol":"WebDriver", "browserName":"internet explorer", "maxInstances":1  },  { "seleniumProtocol":"WebDriver", "browserName":"chrome", "maxInstances":1 "chrome_binary":"c:\sss\chrome.exe"  },  { "seleniumProtocol":"WebDriver", "browserName":"opera", "maxInstances":1  },  { "seleniumProtocol":"WebDriver", "browserName":"safari", "maxInstances":1  }   ],   "configuration":   {      "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",      "maxSession": 5,      "port": 5531,      "hubHost": "IP Address of the Hub",      "register": true,      "registerCycle": 5000,      "hubPort": 4444   }}

Other settings for -browser

  • -browser < params > If -browser is not set, a node will start with 5 firefox, 1 chrome, and 1 internet explorer instance (assuming it’s on a windows box). This parameter can be set multiple times on the same line to define multiple types of browsers.

Parameters allowed for -browser: browserName={android, chrome, firefox, htmlunit, internet explorer, iphone, opera} version={browser version} firefox_binary={path to executable binary} chrome_binary={path to executable binary} maxInstances={maximum number of browsers of this type} platform={WINDOWS, LINUX, MAC}



Relate page:

https://code.google.com/p/selenium/wiki/Grid2

https://code.google.com/p/selenium/source/browse/java/server/src/org/openqa/grid/common/defaults/DefaultNode.json

https://code.google.com/p/selenium/source/browse/java/server/src/org/openqa/grid/common/defaults/DefaultHub.json




聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.