Selenium with Java – Introduction

Selenium with Java – Introduction, What is Selenium, Features of Selenium, History of Selenium, Selenium Tools, and Selenium Test Environment.

Selenium is not an all-inclusive Test Tool, so it requires third-party plugins and frameworks to broaden the scope of testing.

Selenium supports six programming languages to write test cases, in which Java is a popular language for Selenium.

Previous Tutorial                                      Next Tutorial

Selenium with Java – Introduction

1. What is Selenium?
2. Features of Selenium
3. Selenium History
4. Selenium Components / Selenium’s Tool Suite
5. Platforms supported by Selenium
6. Advantages of Selenium
7. Drawbacks of Selenium
8. Selenium Test Environment

1. What is Selenium?

Selenium is a free, open-source automation testing suite for web applications across different browsers and platforms. It is somewhat similar to Micro Focus UFT (Unified Functional Testing).

Selenium supports Functional & Regression Testing at System Test Level and Acceptance Test Level.

Selenium license is Apache 2.0, anybody can download the Software and use it, anybody can modify the source code and use, distribute it to others. But selling the modified code is not allowed.

2. Features of Selenium

i. Open source and Portable:
Selenium is an Open source and Portable Web Testing Framework.

ii. Type of Testing:
Selenium supports Functional & Regression Testing of Web Applications.

iii. Operating System Support:
Selenium supports various Operating environments (MS Windows, Linux, and Macintosh) to conduct Testing.

iv. Programming Language Support:
Selenium supports various Programming Languages (Java, Python, C#.Net, Ruby, JavaScript, and Kotlin) for writing Test Cases.

v. Browser Support:
Selenium supports various Browsers (Google Chrome, Mozilla Firefox, MS Edge, Opera, and Safari) to execute the Test Cases.

vi. Testing Variants:
Selenium supports Batch Testing, Data-Driven Testing, Cross Browser Testing, and Database Testing.

3. Selenium History

All Selenium projects were released under Apache 2.0 license, The Apache License is a free software license, it allows users to use the software for any purpose, to distribute it, and modify it. But selling modified code is not allowed. No commercial transactions are permitted for Selenium Software.

  • Selenium first came to life in 2004 when Jason Huggins was testing an internal application at ThoughtWorks.
  • In 2006 an engineer at Google named Simon Stewart started work on a project he called WebDriver.
  • In 2008, the whole Selenium team decided to merge Selenium Webdriver with Selenium RC in order to form a more powerful tool called Selenium 2.0

Selenium 1.0
(Selenium IDE, Selenium RC, Selenium Grid)

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

Note: Selenium RC is only for maintenance projects.

Selenium 3.0
(Selenium IDE, Selenium WebDriver, Selenium Grid)

Note: Selenium RC was removed from Selenium 3.0.

Selenium 4.0 (* Latest version)
(Selenium IDE, Selenium WebDriver, Selenium Grid)

4. Selenium Components / Selenium’s Tool Suite

Selenium is not just a single tool but a suite of software, each with a different approach to supporting automation testing. It comprises three major components which include:

i. Selenium IDE (Integrated Development Environment)
ii. Selenium Remote Control (Now Deprecated)
iii. Selenium WebDriver
iv. Selenium Grid

i. Selenium IDE

Selenium IDE is a browser plug-in (Firefox and Chrome) and prototype tool.

  • It is used to write and execute test cases
  • User/tester can record the test cases or type test cases
  • User/tester can edit test cases (Add/Update/Delete)
  • Users/Testers can create test suites/test batches
  • Users/Testes 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
  • No Data-Driven testing support.
  • No centralized maintenance of objects/elements
  • It doesn’t generate detailed test results

ii. Selenium RC – (It was removed from the Selenium suite)

iii. Selenium WebDriver

Selenium WebDriver is a powerful tool in Selenium’s tool suite, it has no IDE (Integrated Environment), It is an API (Application Programming Interface).

Selenium WebDriver Test cases can be created using Element locators and WebDriver API commands, and we can enhance test cases using programming and third-party frameworks.

iv. Selenium Grid

  • Selenium Grid is only for Test execution and doesn’t support Test case development
  • Selenium Grid is used for parallel testing, it follows the Hub-Node architecture to achieve parallel execution of test scripts.
  • Selenium Grid executes Selenium Webdriver test cases against different browsers and operating systems using multiple machines (computers).

5. Platforms supported by Selenium

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

i. Operating Systems

MS Windows

ii. Application Environment

CUI (* It doesn’t support)
GUI (It supports Web application only, doesn’t support Desktop applications)

iii. Browsers

Google Chrome
Mozilla Firefox
MS Internet Explorer / MS Edge

iv. Programming Languages


v. Testing Frameworks

Java – JUnit or TestNG
C#.Net – NUnit
Python- unittest, pyunit, py.test
Ruby – RSpec, Test::Unit

Note: The Testing Framework Selection depends on the Programming language.

6. Advantages of Selenium WebDriver

i. Selenium is an Open Source Software.

ii. Selenium supports various programming languages (Java, Python, C#, JavaScript, Ruby, and Kotlin) to write Test scripts.

iii. Selenium supports various operating systems (MS Windows, Linux, and Macintosh)

iv. Selenium supports various Browsers (Mozilla Firefox, Google Chrome, IE, Opera, and Safari)

v. Selenium supports Parallel Test Execution.

vi. Selenium WebDriver uses fewer Hardware resources since it is an API.

vii. Selenium supports Batch Testing, Data-Driven Testing, Cross Browser Testing, and Database Testing.

7. Disadvantages of Selenium WebDriver

i. No reliable Technical Support since it is open-source software.

ii. It doesn’t support Desktop applications.

iii. It is difficult to use, takes more time to create Test cases.

iv. Difficult to Setup Test Environment when it compares to Vendor Tools like UFT, RFT, SilkTest etc…

v. Limited support for Image Testing.

vi. New features may not work properly.

vii. No Test Tool integration for Test Management.

viii. No Built-in Reporting facility.

Java Contribution for Software Testing:

Java can be used in Selenium, Appium, RFT test tools for automation testing. JMeter, Jira, SoapUI, etc, test tools developed in Java technology, Java Runtime is required to use those tools.

Selenium Tutorial for Beginners

Selenium Complete Course Videos

Follow me on social media: