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 HubWebDriver
java -jar selenium-server-standalone-2.29.0.jar
-role hub
-hubConfig hubconfig.json
pause

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 NodeWebDriver
java -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.json
pause

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

Selenium Grid Configuration,布布扣,bubuko.com

时间: 2024-10-19 17:02:59

Selenium Grid Configuration的相关文章

Webdriver - Selenium Grid Configuration

Grid parameter: role = <hub|node> (default is no grid, just run an RC/webdriver server). When launching a node, the parameters will be forwarded to the server on the node, so you can use something like -role node -trustAllSSLCertificates. In that ca

[Selenium+Java] Selenium Grid Tutorial: Command Line and JSON Example

Original URL: https://www.guru99.com/introduction-to-selenium-grid.html What is Selenium Grid? Selenium Grid is a part of the Selenium Suite that specializes in running multiple tests across different browsers, operating systems, and machines in para

Selenium Grid 运行报错 Exception thrown in Navigator.Start first time -&gt;Error forwarding the new session Empty pool of VM for setup Capabilities

Selenium Grid 运行报错 : Exception thrown in Navigator.Start first time ->Error forwarding the new session Empty pool of VM for setup Capabilities [{platform=WINDOWS, ensureCleanSession=true, ignoreProtectedModeSettings=true, ignoreZoomSetting=true, enab

Selenium Webdriver 学习总结-Selenium Grid &amp; Webdriver(九)

QQ群: 136924235 论坛 : http://bbs.shareku.com Google教程:https://code.google.com/p/selenium/wiki/Grid2 Hub / Node 系统要求:JDK.firefox.chrome.internetExplorer 所需工具:selenium-server-standalone-xxx.jar 下载地址:http://code.google.com/p/selenium/downloads/list Start

Selenium grid 分布式测试搭建

应领导要求使用 selenium grid 搭建分布式测试平台,于是有了以下操作: 第一步:准备2台电脑,且2台电脑都安装好jdk,都准备好selenium-server-standalone-2.40.0.jar,IEDriver, ChromeDriver等工具,注意chrome版本与chromedriver需要匹配,详见我的另一篇博客:http://www.cnblogs.com/cherrysu/p/7815245.html 第二步:其中一台电脑作为hub,也就是老大,另一台作为node

Robot Framework + Selenium2Library环境下,结合Selenium Grid实施分布式自动化测试

最近一段时间,公司在推行自动化测试流程,本人有幸参与了自定义通用控件的关键字封装和脚本辅助编写.数据驱动管理.测试用例执行管理等一系列工具软件的研发工作,积累了一些经验,在此与大家做一下分享,也算是做一个总结吧,希望能给大家带来启发和帮助.由于业界没有成熟的解决方案可供参考,本人在研究过程中也是摸着石头过河,纰漏之处在所难免,如果大家有更好的方案,敬请不吝赐教. 分布式并行执行用例需求背景 公司的产品属于web app,采用的是Robot Framework + Selenium2Library

.NET自动化测试工具:Selenium Grid

在生产环境,QA会同时跑几十个上百个的test case.如果用单机串行的话,是一件非常耗时的事情,估计比手点快不了多少.使用并行方案的话,有两种方法,一个是自己写并行框架,一个是用现成的Selenium Grid. 自己写并行框架,好处是一切尽在掌控,有问题可以快速定位,针对业务的定制化程度高,用户用起来方便.目前想到的问题是,如果在单机多账户登录同一系统的情况下,会不会串cookie?不过我发现,可能是浏览器厂商把不同的Driver实例给隔离了,这样就省很多事.实现思路大体是:各Client

Selenium Grid操作使用指南

一.实现串行多浏览器执行脚本1.启动selenium-server-standalonejava -jar selenium-server-standalone-2.44.0.jar2.脚本代码 1 from selenium import webdriver 2 from selenium.webdriver.common.desired_capabilities import DesiredCapabilities 3 import time 4 5 lists = ["chrome&quo

selenium Grid(一)

selenium grid Quick Start selenium-grid是用于设计帮助我们进行分布式测试的工具,其整个结构是由一个hub节点和若干个代理节点组成.hub用来管理各个代理节点的注册和状态信息,并且接受远程客户端代码的请求调用,然后把请求的命令再转发给代理节点来执行. 1.启动Selenium-Server 1)下载 selenium-server-standalone-*.jar,地址:http://selenium-release.storage.googleapis.co