Download presentation
Presentation is loading. Please wait.
Published byElisabeth Wells Modified over 8 years ago
1
Web Automation Testing With Selenium By Rajesh Kanade
2
Course Content Introduction to selenium Webdriver basics Selenium standalone server Selenese command Selenium grid basic Multi environment and multi browser testing with selenium Guidelines for writing a Automation Test Framework.
3
Tools used for Demo CSharp and Java for writing test scripts Selenium webdriver ( IE/Chrome) Browsers ( Chrome, Firefox and IE) Selenium standalone server for Grid Setup
4
Selenium’s Jargon Selenium Core Selenium WebDriver Selenium RC or Remote Control Selenium IDE Selenium-Grid Selenium Standalone Server
5
Selenium Core Selenium Core is the heart of the original Selenium implementation, and is a set of Javascript scripts that control the browser. This is sometimes referred to as "Selenium" and sometimes as "Core". Because Selenium was written in pure Javascript, its initial design required developers to host Core and their tests on the same server as the application under test (AUT)
6
Selenium RC Selenium RC was the name given to the language bindings for Selenium Core, and is commonly, and confusingly, referred to as just "Selenium" or "RC". It has now been replaced by Selenium WebDriver, where RC's API is referred to as the "Selenium 1.x API".
7
Selenium WebDriver Selenium WebDriver fits in the same niche as RC did, and has subsumed the original 1.x bindings. It refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just "WebDriver" or sometimes as Selenium 2
8
WebDriver V/S Selenium RC WebDriverSelenium RC Object-oriented APIDictionary-based API Only supported JavaWide-range of languages Bind natively to the browserSelenium Core ( JavaScript) Side-stepping the browser's security model Playing with browser’s security model
9
Selenium 2 In August, 2009, it was announced that the two projects would merge, and Selenium WebDriver ( Selenium 2) is the result of those merged projects
10
Selenium IDE Selenium IDE is an integrated development environment for Selenium scripts. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Features: Easy record and playback Intelligent field selection will use IDs, names, or XPath as needed Autocomplete for all common Selenium commands Walk through tests Debug and set breakpoints Save tests as HTML, Ruby scripts, or any other format Support for Selenium user- extensions.js file Option to automatically assert the title of every page NEW! Easy customization through plugins
11
What is Selenium Grid? Selenium Grid is a part of the Selenium Suite that specializes on running multiple tests across different browsers, operating systems, and machines in parallel
12
What is a Hub and Node? The Hub The hub is the central point where you load your tests into. There should only be one hub in a grid. The hub is launched only on a single machine, say, a computer whose OS is Windows 7 and whose browser is IE. The machine containing the hub is where the tests will be run, but you will see the browser being automated on the node. The Nodes Nodes are the Selenium instances that will execute the tests that you loaded on the hub. There can be one or more nodes in a grid. Nodes can be launched on multiple machines with different platforms and browsers. The machines running the nodes need not be the same platform as that of the hub.
13
How to Start a Hub? On command line type command java -jar selenium-server- standalone-2.30.0.jar -role hub
14
How to Verify Hub is Running? Open up a browser and go to url http://localhost:4444/grid/console http://localhost:4444/grid/console Here the localhost should be the machine IP where you have run the hub.
15
How to Start a Node?
16
How to configure hub? java -jar selenium-server-standalone.jar -role hub -hubConfig hubConfig.json –debug Sample hubConfig.json {"_comment" : "Configuration for Hub - hubConfig.json", "host": ip, "maxSessions": 5, "port": 4444, "cleanupCycle": 5000, "timeout": 300000, "newSessionWaitTimeout": -1, "servlets": [], "prioritizer": null, "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", "throwOnCapabilityNotPresent": true, "nodePolling": 180000, "platform": "WINDOWS"}
17
How to configure node? java.exe -jar selenium-server-standalone.jar -role node -nodeConfig node1Config.json Sample node1Config.json {"capabilities": [{"browserName": "firefox", "acceptSslCerts": true, "javascriptEnabled": true, "takesScreenshot": false, "firefox_profile": "", "browser-version": "27", "platform": "WINDOWS", "maxInstances": 5, "firefox_binary": "", "cleanSession": true }, {"browserName": "chrome", "maxInstances": 5, "platform": "WINDOWS", "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" }, {"browserName": "internet explorer", "maxInstances": 1, "platform": "WINDOWS", "webdriver.ie.driver": "C:/Program Files (x86)/Internet Explorer/iexplore.exe" }], "configuration": {"_comment" : "Configuration for Node", "cleanUpCycle": 2000, "timeout": 30000, "proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy", "port": 5555, "host": ip, "register": true, "hubPort": 4444, "maxSessions": 5}} java.exe -jar selenium-server-standalone.jar -role node -nodeConfig node1Config.json - Dwebdriver.chrome.driver=chromedriver.exe
18
API Interface for Selenium Grid
19
Selenium Locators
20
References http://www.seleniumhq.org/docs/ http://www.aosabook.org/en/selenium.html http://www.guru99.com/selenium-tutorial.html http://inetfuture.com/2015/03/18/selenium-terms-explained/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.