1. Introduction to Selenium

Introduction to Selenium

Introduction to Selenium Automated Testing, Operating Systems supported by Selenium, Browsers supported by Selenium and Programming platforms supported by Selenium.

Selenium Versions Information, Selenium License Objective and Software Components used for Selenium Testing.

Note: Official website of Selenium is https://www.seleniumhq.org/,

We can download Selenium Software from this website and get Selenium Documentation.

Chapter Index

1) What is Selenium?
2) History of the Selenium Project
3) Selenium Components / Selenium’s Tool Suite
4) Platforms supported by Selenium
5) Selenium License
6) Advantages and Disadvantages of Selenium
7) Software used for Selenium Testing
8) Selenium Automation Framework

1) What is Selenium?

i) Selenium is used for Functional & Regression Testing

(Selenium is used for Automated Testing, we have different types of Automated testing or Test Automation,

a) Automated Functional Testing using Selenium or UFT or RFT or SilkTest etc,

b) Automated Performance Testing using LoadRunner or JMeter etc,

c) Web Services Testing using SoapUI)

ii) Selenium is Open source software to automate web browsers

(We have two types of Software Test Tools,

a) Commercial Tools like UFT, RFT, LoadRunner etc,

b) Open Source Test Tools like Selenium, JMeter, Appium etc,

Note: Selenium is an Open Source Test Tool.

Selenium automates web browsers, means it supports Testing of Web Application only, doesn’t support Desktop Software Applications.

Note: UFT/QTP supports Testing of Desktop and Web Applications.)

iii) Selenium supports various operating environments
MS Windows,
Linux,
Macintosh etc…

(Suppose our AUT (Application Under Test) installed on MS Windows operating environment then you can Selenium for Functional Testing,

Our Software Application on Linux environment, you can use Selenium for Testing,

Our Software Application on Macintosh operating environment, you can use Selenium for Testing.

Note: UFT Tool supports MS windows operating environment only, doesn’t support Linux or Other operating environments.

iv) Selenium supports various Browsers to write and execute Test Scripts
Google Chrome,
Mozilla Firefox,
MS Internet Explorer/ MS Edge
Opera
Safari
etc….

Selenium supports various browsers, Web Element Locators are common for every browser, Selenium WebDriver API commands are common for every browser and Programming concepts also common for all browsers.

Note: Browser driver only varies from one browser to another but Test cases are same for all browsers.

v) Selenium supports various programming languages to write Programs (Test Scripts)
Java,
Python,
C#.NET,
Perl,
Ruby,
PHP

Selenium supports various Programming platforms to write Test Scripts, we can use anyone of those supported languages. UFT (formerly QTP) supports VBScript only to write Test Scripts.

Most of Selenium Testers use Java (Core Java), next Python.

Note:
i) Selenium IDE doesn’t support any Programming
ii) Selenium IDE supports Mozilla Firefox and Chrome browsers only
ii) Selenium Grid is only for Test Execution
iv) Selenium RC is out dated and it was removed from Selenium latest version/s

2) History of the Selenium Project

i) Selenium was first launched in 2004

ii) In 2006, Selenium WebDriver was launched at Google

iii) In 2008, the whole Selenium team decided to merge Selenium WebDriver with Selenium RC in order to
form a powerful tool called Selenium 2.0

Selenium 1.0
(Selenium IDE + Selenium RC + Selenium Grid)

Selenium 1.0 + Selenium WebDriver = Selenium 2.0

Selenium 2.0
(Selenium IDE + Selenium RC + Selenium WebDriver + Selenium Grid)

Selenium 3.0 (October 2016)
(Selenium IDE + Selenium WebDriver + Selenium Grid)
Note: Selenium Team removed Selenium RC from the Suite

3) Selenium Components / Selenium’s Tool Suite

Selenium IDE
Selenium RC
Selenium WebDriver
Selenium Grid

i) Selenium IDE Features:

Selenium IDE (Integrated Development Environment):

  • It is a browser plug-in (Firefox and Chrome) and prototype tool
  • It is used to create and execute Test cases using Firefox or Chrome browsers
  • User can Record the Test Scripts or type Test scripts
  • User can edit Test scripts (Add/Update/Delete)
  • User can create Test Suites
  • User can debug Test Cases and Add Comments

Note: Selenium IDE Test Cases can be created using Element Locators and Selenese Commands

Drawbacks of Selenium IDE:

  • It doesn’t support Programming to enhance test cases, so it is not suitable for complex test design
  • It doesn’t support Parameterization/Data Driven Testing
    (Parameterization – passing parameters (variables or arguments) instead of constant (fixed) values)
  • No centralized maintenance of Objects/Elements
  • It doesn’t generate detailed Test Reports summary only

ii) Selenium RC -Out Dated

iii) Selenium WebDriver Features:

  • Selenium WebDriver doesn’t have IDE and having Programming Interface only

Selenium IDE has IDE but no Programming interface
Selenium WebDriver has No IDE, only Programming Interface
UFT/QTP has both IDE as well as Programming Interface

  • Selenium WebDriver is used to create and execute Test cases/Test scripts
  • Using Element Locators and WebDriver API Commands we can create Test scripts
  • Selenium WebDriver supports various Operating environments, Browsers and programming languages
  • Selenium WebDriver supports Batch Testing, Data Driven Testing, Cross Browser Testing and Database testing

Drawbacks of Selenium WebDriver:

  • Selenium WebDriver has no IDE, so it takes more time and efforts to create Test Scripts
  • No built in Object Repository
    (*using POM we can create object repositories)
  • No built-in Result Reporting facility
    (* using Programming features or using Testing Framework Assert methods)
  • No other Test Tool integration for Test management
  • Difficult to configure Test Environment when it compares to other tools like UFT

iv) Selenium Grid:

  • Selenium Grid is only for Test Execution and it doesn’t Support Test Design
  • Selenium Grid supports Parallel Testing
    (It can execute Test scripts against different browsers and machines (computers)

Selenium IDE is Record & Playback Tool and it is not suitable for complex Testing, Selenium RC was outdated, Selenium Grid is only for Test Execution, so we have only powerful tool in this tool suite is Selenium WebDriver. Focus on Selenium WebDriver, it support programming, various operating systems and various browsers to write & execute Test Cases.

4) Platforms supported by Selenium

Selenium works with various Operating systems, browsers, programming languages and Testing Frameworks

i) Operating Systems
MS Windows
Linux
Macintosh etc…

ii) Application Environment
1) CUI (* doesn’t support)
2) GUI – Desktop (* doesn’t support)
Web (Supports)

iii) Browsers
Google Chrome
Mozilla Firefox
MS Internet Explorer / MS Edge
Opera
Safari
etc…

iv) Programming Languages
Java
Python
C#.Net
Perl
PHP
Ruby

v) Testing Frameworks
Java – JUnit or TestNG
C#.Net – NUnit
PHP: Behat + mink
Python: unittest, pyunit, py.test
Ruby: RSpecc, Test::Unit

Note: Testing Framework Selection depends on Programming platform.

selenium tutorial
Selenium Step by Step Tutorial

5) Selenium License

  • Selenium is an Open Source Software, anybody can download and with free of cost
  • Selenium Projects were released under Apache 2.0 license

Objectives of Apache 2.0 license
i) Anybody can download and use Selenium with free of cost
ii) Anybody can modify the source code and use, and distribute to others
iii) Selling modified code is not allowed

6) Advantages and Disadvantages of Selenium

Advantages of Selenium
i) It is an Open Source Software
ii) It supports various Operating systems
iii) It supports various Programming languages
iv) It supports various browser environments
v) It supports parallel testing
vi) It uses less hardware resources
Etc…

Disadvantages of Selenium
i) It supports only web based applications
ii) No reliable technical support from anybody
iii) No other tool integration for Test Management
iv) No built-in Object Repository
v) No built-in Result Report facility
vi) Difficult to configure Test Environment
vii) Less support for Image based Testing
viii) It takes time and efforts to create Test cases
etc….

7) Software used for Selenium Testing

i) Editor – Eclipse IDE – Editor for writing and executing programs

(Eclipse is an open-source platform of software development and it supports various Operating platforms.

Eclipse was developed for Java applications, plug-ins allow programmers to develop applications with other languages, including C, C++, COBOL, Perl, PHP and Python.)

ii) Programming Platform – Java – To write Test Scripts and enhance Test Scripts

iii) Test Tool – Selenium WebDriver Java language binding – to write Test Steps

iv) Testing Framework – TestNG- prioritizing Test Cases, Grouping Test Cases, Executing Test batches, Parallel Testing and generate Test Reports.

v) Build Automation Tool – Maven – Easily setup Test Environment and easy Maintenance of the Environment

vi) CI Tool – Jenkins – Continuous Integration (integrating Testing process with development process) etc….

8) Selenium Automation Framework

A Framework is a set of rules or best practices and guidelines which we can follow in a systematic way to achieve the desired results.

Selenium Automation Framework is systematic process to automate Software Testing, using this we can optimize the Test Automation activities.

Popular Test Automation Frameworks:

Keyword Driven Testing Framework

Hybrid Testing Framework

Behavior Driven Development Framework Etc,

Note: These are third party frameworks and Framework is not a technology, it is a process.


Next Class

Follow me on social media: