Skip to content

Make Selenium Easy

And Keep It That Way

  • Home
  • Share
  • Toggle search form

TestNG Tutorials 1: Why Do We Require TestNG In Selenium? | Make Selenium Easy

Posted on 12/04/2018 By admin

Hello Folks,

We have written so many automated scripts in previous posts. We wrote those scripts inside a main method. To run that particular script, we ran main method of that particular class.

Let’s assume that we have 100 test scenarios to automate and we developed 100 test scripts using typical style of writing java codes i.e. A class with main method.

  1. If you want to run all test scripts at once, you need to create a separate runner class where you will call main method of each script class. But it will be very difficult to continue or stop script execution when some scripts fails.
  2. It is difficult to run a subset of all test scripts or you have dynamic requirements of running scrips. You manually need to write a lot of codes to handle these scenarios.
  3. Every scenarios can have same or different prerequisites and post requisites conditions. You may need to write duplicate codes repeatedly.
  4. Establishing relationship or dependencies among test scripts will not be easy task.
  5. You need to write a good amount of codes to generate a report which will say status of test run.
  6. Asserting or verifying behavior will require good knowledge of coding.
  7. Parallel testing, categorization and grouping all will require developer’s effort.
  8. If new test scripts need to be added, you might fed up in maintenance and modifications.

Above are some scenarios which need extra coding effort. Will it not be good, if you get something which can perform above scenarios and you just need to plug and use? Your problem will be solved. That something is called TestNG.

Just think what is Selenium. Selenium is also a plug and use library or API, which perform what you want like launching a browser or load a URL. You do not need to require to write the codes by your own. TestNG is also similar to Selenium. It is also a jar file, which provides you so many ready made functionalities to use.

As per TestNG official website, “TestNG is a testing framework designed to simplify a broad range of testing needs, from unit testing (testing a class in isolation of the others) to integration testing (testing entire systems made of several classes, several packages and even several external frameworks, such as application servers).”.

TestNG is a framework because it bundles a lot of functionalities in it and provides to end users. Selenium is also a framework.

More about TestNG in upcoming posts. Stay tuned.

If you have any doubt, feel free to comment below. If you like my posts, please like, comment, share and subscribe. #ThanksForReading

#HappySelenium

My name is Amod Mahajan and I am an IT employee with 4+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went throw so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

Uncategorized

Post navigation

Previous Post: How to Verify if Options in Dropdown are Sorted as Expected In Selenium WebDriver – Java | Make Selenium Easy
Next Post: Java Program 08: Program to find occurrence of individual characters in a given string. | Make Selenium Easy

Related Posts

confirmPopup – Make Selenium Easy Uncategorized
April 5, 2017 – Make Selenium Easy Uncategorized
October 12, 2019 – Make Selenium Easy Uncategorized
image – Make Selenium Easy Uncategorized
Data Driven Testing in Postman Using CSV File Uncategorized
Hierarchy of Selenium Classes and Interfaces – Make Selenium Easy Uncategorized

Recent Posts

  • Getting Started with Selenium 4: What Is New and How to Upgrade from Selenium 3
  • Manual Testing
  • Baby Steps To Become Efficient Selenium-Java Automation Tester
  • Features of Selenium 4.0.0 Release – Java Binding
  • Part 1: Handling Drop-down Created Using SELECT Tag In Selenium

Recent Comments

No comments to show.

Archives

  • April 2026
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • April 2024
  • March 2024
  • February 2024
  • December 2023
  • October 2023
  • August 2023
  • November 2022
  • September 2022
  • August 2022
  • July 2022
  • May 2022
  • March 2022
  • October 2021
  • April 2021
  • March 2021
  • January 2021
  • December 2020
  • October 2020
  • September 2020
  • August 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • May 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • January 2018

Categories

  • Getting Started
  • Uncategorized

Copyright © 2026 Make Selenium Easy.

Powered by PressBook Masonry Dark