In this session you will learn:
FEATURES OF SELENIUM
COMPONETS OF SELENIUM
SELENIUM IDE
SELENIUM RC
SELENIUM Web Driver
SELENIUM GRID
SELENESE
For more information: https://www.mindsmapped.com/courses/quality-assurance/qa-software-testing-training-for-beginners/
3. Page 3Classification: Restricted
• History of Selenium
• What is Selenium.
• Components of Selenium.
• Selenium IDE
• Selenium RC
• Selenium Webdriver
• Selenium Grid
• Selenese
• Testing With Selenium
Selenium Overview
4. Page 4Classification: Restricted
Why the Name Selenium?
It came from a joke which Jason cracked one time to his team. Another
automated testing framework was popular during Selenium's development,
and it was by the company called Mercury Interactive (yes, the company
who originally made QTP before it was acquired by HP).
Since Selenium is a well-known antidote for Mercury poisoning, Jason
suggested that name. His teammates took it, and so that is how we got to call
this framework up to the present.
5. Page 5Classification: Restricted
Who developed Selenium?
• Selenium was created by Jason Huggins in 2004. An engineer at
ThoughtWorks, he was working on a web application that required
frequent testing. Having realized that the repetitious manual testing of
their application was becoming more and more inefficient, he created
a JavaScript program that would automatically control the browser's
actions. He named this program as the "JavaScriptTestRunner.“
• Seeing potential in this idea to help automate other web applications , he
made JavaScriptRunner open-source which was later re-named as Selenium
Core.
6. Page 6Classification: Restricted
Birth of Selenium Remote Control (Selenium RC)
Unfortunately; testers using Selenium Core had to install the whole
application under test and the web server on their own local computers
because of the restrictions imposed by the same origin policy. So another
ThoughtWork's engineer, Paul Hammant, decided to create a server that will
act as an HTTP proxy to "trick" the browser into believing that Selenium Core
and the web application being tested come from the same domain. This
system became known as theSelenium Remote Control or Selenium 1.
Birth of Selenium Grid
Selenium Grid was developed by Patrick Lightbody to address the need of
minimizing test execution times as much as possible. He initially called the
system "Hosted QA." It was capable of capturing browser screenshots during
significant stages, and also of sending out Selenium commands to different
machines simultaneously.
8. Page 8Classification: Restricted
• Selenium is a Functional Automation tool for Web
applications.
• Selenium is an open source tool (No cost Involved in it).
• Selenium supports the languages like HTML, Java, PHP,
Perl, Python, Ruby and C#.
• It supports the browsers like IE, Mozilla Firefox, Safari,
Google Chrome and Opera.
• It supports the operating systems like Windows, Linux and
Mac.
• It is very flexible when compared to QTP and other
functional tools, because it supports multiple languages.
FEATURES OF SELENIUM
10. Page 10Classification: Restricted
• IDE stands for Integrated Development Environment.
• Which is used for Record and Play back the scripts.
• It is an Add on for Mozilla Firefox, which means we can
download the Selenium IDE from Mozilla Firefox and we
can Record and Run the scripts in Mozilla Firefox only.
• Selenium IDE is accountable for user actions.
• We can Run the Recorded scripts against other browsers
by using Selenium RC
SELENIUM IDE
11. Page 11Classification: Restricted
Advantages :
Very easy to install
No programming experience is required
Can export tests to Selenium RC and webdriver usable formats
Disadvantage :
Available only in Firefox
Test Execution is slow compared to Selenium RC and WebDriver
12. Page 12Classification: Restricted
Selenium IDE – Why Choose
• To learn about concepts on automated testing and Selenium, including:
• Selenese commands such as type, open, clickAndWait, assert, verify,
etc.
• Locators such as id, name, xpath, css selector, etc.
• Executing customized JavaScript code using runScript
• Exporting test cases in various formats.
• To create tests with little or no prior knowledge in programming.
• To create simple test cases and test suites that you can export later to RC
or WebDriver.
• To test a web application against Firefox only.
13. Page 13Classification: Restricted
• RC stands for Remote Control.
• It is a Server and launches the Browser.
• It acts as a API and Library of Selenium.
• We need to configure the Selenium RC with the supported
language, then we can automate the application.
Selenium RC
14. Page 14Classification: Restricted
Advantage :
• Cross browser and cross platform
• Can perform looping and conditional operations
• Can support data driven testing
• Faster execution than IDE
Disadvantage :
• Installation is more complicated than IDE
• Must have Programming knowledge
• Needs selenium RC server to be running
• Slower execution times than webdirver
15. Page 15Classification: Restricted
The WebDriver proves itself to be better than both Selenium IDE and
Selenium RC in many aspects. It implements a more modern and stable
approach in automating the browser's actions. WebDriver, unlike Selenium
RC, does not rely on JavaScript for automation. It controls the browser by
directly communicating to it.
The supported languages are the same as those in Selenium RC.
• Java
• C#
• PHP
• Python
• Perl
• Ruby
SELENIUM Web Driver
16. Page 16Classification: Restricted
Advantage :
• Simpler installation than Selenium RC
• Communicates directly with browser
• No need for a separate component such as RC
• Faster execution time than IDE and RC
Disadvantage:
• Installation is more complicated than IDE
• Requires Programming knowledge
• Cannot readily support new browsers
17. Page 17Classification: Restricted
Selenium Grid is used for launching the multiple browsers with
supported operating system in parallel.
We can run the scripts on different browsers in parallel.
It allows you to easily run multiple tests in parallel, on multiple
machines, in a heterogeneous environment.
SELENIUM GRID
18. Page 18Classification: Restricted
SELENESE
• Selenium commands, often called selenese. The set of these commands are
nothing but test script.
• If you want to write test scripts for any application, initially you need to
integrate Selenium with Java by using Eclipse. (check the Integration doc).
• After completion of the integration, First we need to create the selenium
object as below.
19. Page 19Classification: Restricted
Generally we use the below selenium commands to work on any application:
• Start(): To launch the Browser.
• Open(): To open the url.
• Close(): To kill or close the Browser.
• windowMaximize(): To maximize the window.
• Type(): To enter some text into a text box.
• Click(): To click on Button, Radio button and Link.
• Select(): To select a value or label from combo box or list box or Drop down.
20. Page 20Classification: Restricted
• Check(): To check the check box.
• selectPopUp(): To identify the pop up window.
• selectWindow(): To identify the child window.
• selectFrame(): To identify the frame.
• getAlert(): To Click ok on alert box.
• getConfirmation(): To click ok on confirmation message.
• chooseCancelOnNextConfirmation(): To click Cancel on next displayed
confirmation message.
• chooseOkOnNextConfirmation(): To click Cancel on next displayed
confirmation message.
21. Page 21Classification: Restricted
Selenium RC
• To design a test using a more expressive language than Selenese
• To run your test against different browsers (except HtmlUnit) on different
operating systems.
• To deploy your tests across multiple environments using Selenium Grid.
• To test your application against a new browser that supports JavaScript.
• To test web applications with complex AJAX-based scenarios
22. Page 22Classification: Restricted
Selenium Webdriver
• To use a certain programming language in designing your test case.
• To test applications that are rich in AJAX-based functionalities.
• To execute tests on the HtmlUnit browser.
• To create customized test results.
23. Page 23Classification: Restricted
Selenium Grid
• To run your Selenium RC scripts in multiple browsers and operating systems
simultaneously.
• To run a huge test suite, that need to complete in soonest time possible.
24. Page 24Classification: Restricted
Assignment
1. What are the Testing Tools you know?
2. Do you know any testing Tool which tests cross-browser compatibility?
3. Find any five testing tools. Provide brief description about the tool.
4. Find any 5 differences between the Functional Unit Test Tools you know
and Selenium.
5. What is a Open Source Project?
6. What is a GPL (General Public License)?
7. What are the web development mark-up languages you know?
8. What are the scripting languages you know?