Selenium The Beginning

Selenium The Beginning

i) What is Selenium?

ii) Selenium Components / Selenium’s Tool Suite

iii) Advantages and Disadvantages of Selenium

iv) Selenium Environment Setup
——————————
i) What is Selenium?

• Selenium is a Suite of Software Tools to automate Web Browsers.

(Selenium is not a single tool like UFT, RFT, SilkTest etc…, It is a suite of tools, they are Selenium IDE, Selenium RC, Selenium WebDriver and Selenium Grid. Selenium supports Web Applications only, doesn’t support Desktop Applications and Other Applications.)

• Selenium is an Open source Software released under the Apache 2.0 License, mainly used for Functional and Regression Testing.

(Anybody can download and use Selenium tools with free of cost, anybody can modify the source code and distribute the source code but selling modified source code is not allowed. The primary objective of Apache 2.0 license is Selling source code is not allowed. Selenium is mainly used for Functional Test Automation, other tools in this category are HP-UFT, IBM-RFT, Micro Focus – SilkTest, Test Complete, Test Partner etc…)

• Selenium supports various Operating Environments to create and execute Test cases.

(Suppose our AUT (Application Under Test) deployed on Windows, we can use Selenium for Test Automation Or Our AUT on Linux Environment, we can use Selenium or Our AUT deployed on Macintosh environment then we can use Selenium for Test Automation. UFT (formerly QTP) supports MS Windows operating environment only.)

Selenium Supports:

MS Windows

Linux,

Macintosh etc…

• Selenium supports various programming environments to write Programs (Test Scripts)

Selenium supports:

Java,

C#,

Perl

Python,

Ruby

PHP

(Selenium supports various programming languages to write Test Scripts, we can select any one of those languages, nowadays most of the Selenium Testers using Java (nearly 77%))

Note: Selenium IDE doesn’t support Programming.

• Selenium supports various Web Browsers.

Mozilla Firefox,

Google Chrome,

IE,

Opera,

Safari etc…

(Selenium supports cross browser testing, Test Cases are same for all browsers but browser driver various from one browser to another, Mozilla Firefox is the default browser in Selenium. If you want to execute Test Cases using Chrome browser then download Chrome browser driver and set driver executable file path in Selenium Test Cases, follow same method for IE, Safari, Opera etc… Browsers.)

Note: Selenium IDE supports only Mozilla Firefox.

• Selenium supports various Testing Frameworks that depends on Programming environment.

(Using Testing Framework we can Group Test Cases, Prioritize Test Cases, Execute Test Batches and Generate Test Reports.)

Example:

Java – JUnit, TestNG

C#.NET – NUnit
——————————
ii) Selenium Components / Selenium’s Tool Suite

• Selenium first came to life in 2004

• In 2006, Selenium WebDriver was launched at Google.

• In 2008, the whole Selenium team decide to merge WebDriver with RC (Remote Control) in order to form more power tool called Selenium 2.0.

Selenium 1.0

(Selenium IDE + Selenium RC + Selenium Grid)

Selenium 2.0

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

Selenium 1.0 + WebDriver = Selenium 2.0

Selenium Components / Selenium’s Tool Suite

1) Selenium IDE

2) Selenium RC

3) Selenium WebDriver

4) Selenium Grid
——————————
1) Selenium IDE (Integrated Development Environment)

It is Firefox browser plug in, works only on Firefox.

Selenium IDE Features

• It is a prototyping tool to create and execute Test Cases.

• Create Test Cases, form Test suites
(Using Recording we can generate Test cases or using Element Locators and Selenese Commands we can type Test Steps.)

• Execute Test Case, Test Suite

• Edit Test Cases

• Debug Test Cases

• Export Test Cases to other formats (supporting formats, ex: Java, Ruby etc…)
(* Selenium IDE Test Case default format is .html)

Selenium IDE Drawbacks

• It supports only Mozilla Firefox browser.

• It doesn’t support programming.

• It doesn’t support Data driven Testing

• It doesn’t generate detailed Test Reports.
——————————
2) Selenium RC (* Out Dated)
——————————
3) Selenium WebDriver

It is a Programming Interface, doesn’t have IDE.

Selenium IDE – IDE, no Programming
Selenium WebDriver – Programming Interface, no IDE
——————————
UFT – IDE and Programming Interface
——————————
Selenium WebDriver Features

• It has Programming Interface only, using Element Locators and WebDriver Commands we can create Test Cases.

• It supports various Operating Environments (MS Windows, Linux, Mac etc…)

• It supports various Browsers (Mozilla Firefox, Google Chrome, IE, Safari, Opera etc…)

• It supports various Programming environments (Java, C#, Python, Perl, Ruby and PHP)

• It supports Data driven Testing, Cross browser Testing and Batch Testing.

• It supports Parllel test execution with help of Either selenium Grid or TestNG Framework.
——————————
Drawbacks of Selenium WebDriver

• It doesn’t have IDE, so it takes more time to create Test cases.

• No built-in Result Reporting facility.

• No built in spread sheet for Data related operations
——————————
4) Selenium Grid

• It is used to execute Test cases across multiple browsers, operating environments and computers in parallel.

• Selenium Grid 2.0 supports Selenium RC Test Cases and Selenium WebDriver Test Cases.

Note: Selenium Grid doesn’t support Test Case Design, it is only for Test Case Execution. It supports various operating environments, browsers to execute Tests in parallel.
——————————
Focus on:

Selenium WebDriver – to Create and Execute Test Cases

Java Programming – To Enhance Test Cases

TestNG – To Group Test Cases, Prioritize Test Cases, Batch Testing and Generate Test Reports.
——————————
iii) Advantages and Disadvantages of Selenium

Advantages:

• It is an Open source Software (Free of Cost)

• It supports various Operating environments, Browsers and Programming environments.

• It supports Parallel Test Execution
etc…
——————————
Disadvantages:

• It supports Web Applications only.

• No reliable Technical support

• Limited support for Image Testing

• No other tool integration for Test Management.

• Takes more time to create Test cases in Selenium WebDriver

• Difficult Setup Test Environment
Etc…
——————————
iv) Selenium Environment Setup

Choose Selenium Tools

Selenium WebDriver,

Java,

TestNG etc…
——————————
Test Environment Setup

• Download and extract Eclipse IDE

• Download and Install Java (jdk) Software.

• Download Selenium WebDriver Java language bindings form seleniumhq.org and Add WebDriver jar files to Java project in Eclipse IDE

• Download Browser drivers (Chrome, IE etc…) and Extract.

• Download TestNG framework from Eclipse and install.
——————————
Test Automation using Selenium

• Using WebDriver (Element Locators and WebDriver Commands / Methods to create Test Cases)

• Java Programming (Insert Verification points, Synchronization, Parameterization, Error handling and Add comments etc…)

• TestNG Framework (Group Test Cases, Prioritize Test Cases, Execute Test Cases/Test Batches, and Generate Test Reports.)
——————————
Related Questions:

1) Is Selenium used for Performance Testing also?

2) How to generate Test Reports in Selenium WebDriver?

3) Is Selenium supports Mobile Testing?

4) Suppose we created some 100 Test Cases on MS Windows, Shall we execute these 100 Test Cases (Same Test Cases) on Linux or Macintosh operating environments?

5) What is the default Browser in Selenium?

6) Can we execute Tests in Parallel without using Selenium Grid?

7) Can we conduct Batch Testing in Selenium WebDriver without using any Testing Framework support or Selenium Grid support?

8) Selenium released under the Apache 2.0 license, what is the primary object of Apache 2.0 License?

9) Who provides Technical support for Selenium?
(For example HP Company provides Technical support for UFT/QTP.)

10) Is Selenium supports SAP Applications for Automation?
——————————
Selenium Quick Tutorials

Tutorial 1: Introduction to Selenium
http://www.gcreddy.com/2016/06/selenium-the-beginning.html

Tutorial 2: Selenium Test Life Cycle
http://www.gcreddy.com/2016/06/selenium-test-life-cycle-2.html

Tutorial 3: Java Quick Tutorial for Selenium Part-1
http://www.gcreddy.com/2016/06/java-quick-tutorial-for-selenium.html

Tutorial 4: Java Quick Tutorial for Selenium Part-2
http://www.gcreddy.com/2016/06/java-quick-tutorial-for-selenium-part-2.html

Tutorial 5: Selenium Quick Tutorial Part-1
http://www.gcreddy.com/2016/06/selenium-webdriver-quick-tutorial.html

Tutorial 6: Selenium Quick Tutorial Part-2
http://www.gcreddy.com/2016/07/selenium-webdriver-quick-tutorial-part-2.html

Tutorial 7: TestNG Framework in Selenium
http://www.gcreddy.com/2016/07/testng-framework-quick-tutorial-for-selenium.html
——————————

Follow me on social media: