Selenium Tutorial

Selenium Tutorial for beginners

1) What is Selenium?

Selenium is an Open source Software and it was launched in 2004.

Selenium is a suite of Tools to automate web browsers across many platforms, Means it is only for automating web based applications, not for Desktop applications and its supports various operating environments like Windows, Linux etc… and various Browsers like Mozilla Firefox, IE, Chrome, Opera etc…

Selenium Supports various programming and scripting Languages for applying programming logic to our Tests.
It Supports:

Java, C#, Perl, Python, Ruby and PHP Languages, most of the companies use Java Language, So you also try to use Java Language.

Why Java only? Why can’t we use other languages, most of the supporting and help documentation and implementations available on Internet in Java only, if we use another languages then support is very less.

Selenium supports:

Functional and Regression Testing of Web Applications
Performance Testing

Note: Using Selenium for Performance Test Automation is not recommendable.

2) Selenium’s Suite of Tools:

Selenium is a set of software tools each with a different approach to support Test Automation.

a) Selenium IDE
b) Selenium RC (Remote Control)
c) Selenium WebDriver
d) Selenium Grid

3) Selenium IDE

Selenium IDE (Integrated Development Environment) is a tool for generating test scripts. It is a Firefox plugin.

Features of Selenium:

•    Record and Play back Test Cases
•    Exporting Test Cases to different Languages

Disadvantages of Selenium IDE:

•    It supports Mozilla Firefox Browser only.
•    Data Driven Testing (executing tests using mulpiple sets of test data) is not possible.
•    Test Results are not generated using Selenium IDE (It generats summary only).
•    Random Test Cases execution is not possible
•    Selenium IDE doesn’t support Flow control Statements.

4) Selenium RC (Remote Control)

 Selenium RC solves the limitations of Selenium IDE. It supports various programming languages like Java, C#, PHP, Perl, Python and Ruby languages to achieve logic required in test cases like conditional statements, iterations, exception handling, test reporting, database testing, capturing screen shots of failed tests, test case grouping etc...

Important advantages of Selenium RC:

•    It supports Random Test cases execution
•    Supports Flow control statements and other programming features to enhance Tests.
•    Supports various Browsers for Tests execution.

Disadvantage of Selenium RC:

•    Test Case execution time is more because every client request first send to Selenium Server after that send to Browser.
•    Executing Tests in parallel is not possible.

5) Selenium-Grid:

Selenium-Grid allows the Selenium RC solution to scale for large test suites and for test suites that must be run in multiple environments. 

Selenium Grid allows you to run your tests in parallel, that is, different tests can be run at the same time on different remote machines.

6) WebDriver:

The biggest change in Selenium recently has been the inclusion of the WebDriver API. Selenium WebDriver fits in the same role as RC did.

WebDriver is designed in a simpler and more concise programming interface along with addressing some limitations in the Selenium-RC API.

WebDriver overcomes the limitation of Selenium RC (Remote Control)

Selenium-WebDriver supports the following browsers along with the operating systems these browsers are compatible with.

•    Google Chrome
•    Internet Explorer 6, 7, 8, 9, 10 - 32 and 64-bit where applicable
•    Firefox: latest ESR, previous ESR, current release, one previous release
•    Safari
•    Opera
•    HtmlUnit
•    phantomjs
•    Android (with Selendroid or appium)
•    iOS (with ios-driver or appium)

7) Advantages of Selenium

•    Since this is an Open source Software (free tool), anybody can down load and use with free of cost, it often is one of the few options for companies that do not have a lot of budget for Automation tools.
•    Selenium was first written in Java but it also supports C#, Ruby, Perl, PHP and Python. This is a big plus when we want to build our framework in a language that has the highest adoption in the organization it is being built within. Tools like QTP force you to use VBScript – which is almost never the preferred scripting language for developers.
•    It has support for all of the popular browsers like IE, Firefox, Chrome, Safari etc. It also supports several Operating Systems and that makes it a tool of choice for cross browser/ cross platform certification.
•    Once you get Selenium to work for you, it works reliably when used for running the tests over and over again. It’s definitely a lot more reliable than tools like QEngine or JExplorer but about the same as tools like QTP.
•    You can instantiate several concurrent tests with Selenium Grid. Good luck trying that with tools like QTP!

8) Disadvantages of Selenium

•    Supports Web based (Browser based) Application only, doesn't support Desktop or standalone Application test automation.
•    Since it is Open source software, no reliable technical support from anybody.
•    Some new features may work or may not work properly.
•    Deploying Selenium Tool is difficult than UFT (Formerly QTP) Tool.

9) Selenium Certification:

No Authorized Certification for Selenium Tool, some organizations are conducting Selenium certification exam but
no value guaranty for them in the IT Industry.


Post a Comment