Selenium and TestNG framework
By: Akash S
Tags: Selenium, Testng Framework, Software Testing, Software Development

In this blog, we will look into the Selenium and TestNG framework. In the previous blog, we saw about Test Automation. If you haven’t read the previous one, then have a look at it and come back here.

What is Selenium?

Selenium is an open-source tool that automates web browsers. It is an automated testing framework used to validate web applications across different browsers and platforms. It provides a single interface that lets you write test scripts in programming languages like Ruby, Java, NodeJS, PHP, Perl, Python, C# and others.

Selenium Software is not just a single tool but a suite of software.

Components of Selenium:

1)Selenium Integrated Development Environment (IDE).

2)Selenium Remote Control (RC).

3)Selenium WebDriver.

4)Selenium Grid.

Before explaining all the selenium software let's see a bit of the funny and interesting history of Selenium.

Selenium was created by Jason Huggins in 2004. Before the birth of the Selenium, there was another popular framework made by the company called Mercury Interactive. Selenium is a well-known antidote for Mercury poisoning, Jason had kept the name Selenium.

Selenium Integrated Development Environment (IDE):

Selenium IDE (Integrated Development Environment) is an open-source web automation testing tool t does not require any programming logic to write its test scripts rather you can simply record your interactions with the browser to create test cases. You can also use the playback option to re-run the test cases.

Selenium RC:

Selenium RC consists of two parts:

Client libraries where we write the scripts that will automate the browser.

RC server will launch and close the browser automatically.

When the test scripts are written, then the RC server will inject the JavaScript program called Selenium core in the browser. Once it is injected It will receive the command from the RC server then the selenium core will execute all these instructions as JavaScript commands.

Selenium WebDriver:

Since the RC server communicates with the browser via a JavaScript program, the execution speed is slow. But the web driver doesn’t have any proxy server. It controls the browser directly from the OS hence the execution speed is very high. This what makes WebDriver the best choice in the selenium suite.

Selenium Grid:

Selenium Grid is a tool used together with Selenium RC to run parallel tests. Parallel tests mean running your Selenium RC scripts in multiple browsers and operating systems simultaneously.

Selenium 2 is nothing but integration of WebDriver with Selenium RC(Selenium1). After this new version of Selenium started to roll out and few features in the existing version started to deprecate.

Now we will see what is TestNG framework.

TestNG framework:

TestNG, NG stands for “Next Generation”.

TestNG is a very important framework, it provides you full control over the test cases and the execution of the test cases. Due to this reason, TestNG is also known as a testing framework.

If you want to run a multiple test case, we may need some test cases that need to be executed first before the actual test case.

In TestNG, annotations are easier to understand. It produces the HTML reports for implementation. It also generates Logs. Parallel execution of test cases, i.e., running multiple test cases is only possible in the TestNG framework.

In the next blog, we’ll see about the Performance testing and tools required to do performance testing i.e., Apache Jmeter.

Hope you enjoyed reading the article!!

If you have any queries, please post in the comment section below. Connect with me on LinkedIn.

Thanks for reading this article and Have a great day.