Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.

Similar presentations


Presentation on theme: "Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel."— Presentation transcript:

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.

6

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 -hub http://localhost:4444/grid/register Check that the node was registered: http://localhost:4444/grid/console

9 Use the RemoteWebDriver 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: DesiredCapabilities capability = DesiredCapabilities.firefox();  Pass that into the RemoteWebDriver object:RemoteWebDriver WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);

10 A node matches if all the requested capabilities are met. To request specific capabilities on the grid, specify them before passing it into the WebDriver object. capability.setBrowserName(); capability.setPlatform(); capability.setVersion() capability.setCapability(); The capabilities that are not specified will be ignored.

11 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=

12 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 }

13 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 }


Download ppt "Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel."

Similar presentations


Ads by Google