Download presentation
Presentation is loading. Please wait.
Published byJade Bradford Modified over 8 years ago
1
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel
2
2 Day 4 Selenium Grid
3
Cut execution time by distributing tests on several machines ( parallel execution ) Run the tests against a vast combination of browsers / OS Selenium Grid is not tied to a specific application. ◦ Can be shared by multiple applications and projects
4
Selenium Grid is designed for efficient web acceptance/functional testing. Selenium Grid is NOT designed for performance and load testing ◦ performance/load testing with real browser is hard ◦ hard/expensive to scale the load ◦ actual load is very inconsistent
5
For load/performance testing use tools like PushToTest, JMeter, Grinder or httperf. ◦ Reuse selenium tests for load testing 200 concurrent users = 200 concurrent browsers using Selenium Grid At least 10 machines JMeter/Grinder/httperf can generate the same kind of load with a single machine.
7
Open cmd Go to the location of your selenium-server- standalone-*.jar Execute command: java -jar selenium-server-standalone-*.jar -role hub Check that the hub was started: http://localhost:4444/grid/console
8
Open cmd Go to the location of your selenium-server- standalone-*.jar Execute command: java -jar selenium-server-standalone-*.jar -role node Check that the node was registered: http://localhost:4444/grid/console
9
Open cmd Go to the location of your selenium-server- standalone-*.jar Execute command: java –jar selenium-server-standalone-*.jar -role node –port Check that the node was registered: http://localhost:4444/grid/console
10
java –jar selenium-*.jar –role hub – port Replace with a 4 digit number Register node with non-default hub java –jar selenium-*.jar –role node –hub http://hub_host: ** OR ** java –jar selenium-*.jar –role node -hubHost -hubPort
11
Use the Remote webDriver and the DesiredCapabilities object to define which browser, version and platform you wish to use. Create the target browser capabilities you want to run the tests against: ds_capabilities=DesiredCapabilities.FIREFOX Pass that into the Remote object:Remote webdriver.Remote( command_executor="http://192.168.4.237:4444/wd/hub", desired_capabilities=ds_capabilities)
12
A node matches if all the requested capabilities are met. To request specific capabilities on the grid, specify them before passing it into the Remote WebDriver object. { "browserName": "firefox", "version": "42.0", "platform": "Windows", "javascriptEnabled": True } The capabilities that are not specified will be ignored.
13
By default, node starts with 11 browsers: 5 Firefox, 5 Chrome, 1 Internet Explorer To change browser settings, you can pass in parameters to each -browser switch -browser browserName=, version=, firefox_binary= OR chrome_binary=, maxInstances=, platform=
14
java -jar selenium-server-standalone.jar -role node -nodeConfig nodeconfig.json Example JSON file { "capabilities": [ { "browserName": "*firefox", "maxInstances": 5, "seleniumProtocol": "Selenium" } ],. "configuration": { "proxy": "org.openqa.grid.selenium.proxy.Defaul tRemoteProxy", "maxSession": 5, "port": 5555, "host": ip, "register": true, "registerCycle": 5000, "hubPort": 4444, "hubHost": ip }
15
java -jar selenium-server-standalone.jar -role hub -hubConfig hubconfig.json Example JSON file { "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 }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.