Selenium with Java Tutorial Home / Video /

How to Perform Unit Testing with JUnit | JUnit 5 Tutorial | LambdaTest

How to Perform Unit Testing with JUnit | JUnit 5 Tutorial | LambdaTest

...Playlist

...
  • How To Measure Code Coverage Using JaCoCo in Selenium 4 Java
  • Mastering Authentication Testing in Selenium 4 Java
  • Automating Passwordless Authentication in Selenium 4 Java
  • Single Sign-On (SSO) Automation in Selenium 4 Java
  • How to Perform Unit Testing in Selenium 4 Java
  • Handling ElementClickInterceptedException in Selenium 4 Java
  • Using Thread.sleep() in Selenium 4 Java
  • How To Generate Extent Reports in Selenium 4 Java
  • How To Get Response Status Code Using Apache HTTP Client in Selenium 4 Java
  • How To Find Elements By Text In Selenium WebDriver in Selenium 4 Java
  • How To Handle Multiple Windows In Selenium in Selenium 4
  • How To Select Multiple Checkboxes In Selenium WebDriver in Selenium 4 Java
  • How To Handle Modal Dialog Box In Selenium WebDriver in Selenium 4 Java
  • How to Handle Stale Element Reference Exceptions in Selenium 4 Java
  • How To Automate Signup Forms in Selenium 4 Java | Part-I
  • How To Automate Email Testing in Selenium 4 Java | Part-II
  • How To Handle Captcha In Selenium 4 Java | Part-III
  • How To Handle Cookies In Selenium 4 Java | Part-IV
  • How To Handle Waits In Selenium 4 Java | Part-V
  • How To Handle Exceptions In Selenium 4 Java | Part-VI
  • How To Use Event Listeners In Selenium WebDriver? | Part-VII
  • How To Handle Shadow DOM In Selenium 4 Java | Part-VIII

About The Video

In this JUnit 5 Tutorial, join Anton Angelov (@angelovstanton), Co-founder & CTO of Automate The Planet Ltd., as he provides an in-depth guide to unit testing in Java.

Video Chapters

00:00 Introduction

01:58 What is Unit Testing?

05:12 Setup IntelliJ & Simple Demo

11:08 WebDriver Integration Demo

25:40 LambdaTest Execution

28:30 Parallel Test Execution

30:26 Data-driven tests

33:20 CLI tests execution

34:20 TestNG Demo

36:25 Closing Words

Key Topics Covered

Introduction to Unit Testing: The video begins with an explanation of what unit testing is and its importance in software development. Unit testing involves writing tests for the smallest parts of an application, such as functions or methods, to ensure they behave as expected.

JUnit vs. TestNG: Anton discusses the two popular unit testing frameworks in Java: JUnit and TestNG. He mentions that JUnit is slightly more used than TestNG but plans to cover both frameworks in the video.

Setting Up JUnit and TestNG in IntelliJ: The tutorial includes a walkthrough on setting up a standard environment for both JUnit and TestNG in the IntelliJ IDE. This setup involves configuring Maven dependencies for JUnit 5 (Jupiter) and TestNG.

Annotations and Assertions: Key annotations and assertions used in JUnit and TestNG are explained. Annotations like @Test mark methods as test methods, while assertions are used to validate the behavior of the code being tested.

Running Tests in Parallel and Data-Driven Testing: Anton covers advanced testing strategies such as running tests in parallel to speed up the testing process and data-driven testing, which allows for testing with different input parameters.

Selenium Web Tests with JUnit: The video demonstrates how to integrate Selenium with JUnit for web testing, using data-driven tests to automate scenarios based on different input parameters. The LambdaTest playground website is used as an example for automation.

TestNG Examples: Towards the end of the video, TestNG is revisited with examples similar to those shown for JUnit. The differences in annotations and data-driven testing approaches between JUnit and TestNG are highlighted.

Maven Command Line Execution: Anton shows how to run tests using Maven from the command line, emphasizing the importance of this technique for continuous integration and deployment processes.

Related Blogs & Hubs

Thread.sleep() Method in Java – Complete Tutorial With Example

How To Generate Extent Reports In Selenium

How To Handle Multiple Windows In Selenium WebDriver Using Java?

How To Find Element By Text In Selenium WebDriver

Anton Angelov

Anton Angelov

Anton Angelov, a distinguished figure in software testing, is the CTO & Co-founder of Automate The Planet. Widely recognized for his innovative contributions, he is the inventor of the BELLATRIX Test Automation Framework, a powerful tool transforming the landscape of automated testing.

More Videos from Selenium with Java Tutorial

LT Video

How To Measure Code Coverage Using JaCoCo | Selenium 4 Tutorial | LambdaTest

Selenium with Java Tutorial
LT Video

Mastering Authentication Testing with Selenium Java | Selenium 4 Tutorial | LambdaTest

Selenium with Java Tutorial
LT Video

Automating Passwordless Authentication using Selenium WebDriver | Selenium 4 Tutorial | LambdaTest

Selenium with Java Tutorial
LT Video

Single Sign-On (SSO) Automation in Selenium Java | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How to Perform Unit Testing in Selenium Java | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

Handling ElementClickInterceptedException in Selenium Java | Selenium 4 Tutorial | LambdaTest

Selenium with Java Tutorial
LT Video

Using Thread.sleep() in Java | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Generate Extent Reports In Selenium 📝| Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Get Response Status Code Using Apache HTTP Client 👨‍💻| Selenium 4 With Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Find Elements By Text In Selenium WebDriver 🔍 | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Handle Multiple Windows In Selenium 🖥️ | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Select Multiple Checkboxes In Selenium WebDriver✅| Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Handle Modal Dialog Box In Selenium WebDriver | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How to Handle Stale Element Reference Exceptions | Selenium 4 Tutorial with Java | LambdaTest

Selenium with Java Tutorial
LT Video

How To Handle Shadow DOM In Selenium 🤔| Selenium 4 Tutorial with Java | Part-VIII

Selenium with Java Tutorial
LT Video

How To Use Event Listeners In Selenium WebDriver? | Selenium 4 Tutorial with Java | Part-VII

Selenium with Java Tutorial
LT Video

How To Handle Exceptions In Selenium 🤔| Selenium 4 Tutorial with Java | Part-VI

Selenium with Java Tutorial
LT Video

How To Handle Waits In Selenium 🕘| Selenium 4 Tutorial with Java | Part-V

Selenium with Java Tutorial
LT Video

How To Handle Cookies In Selenium 🤷| Selenium 4 Tutorial with Java | Part-IV

Selenium with Java Tutorial
LT Video

How To Handle Captcha In Selenium 🤷| Selenium 4 Tutorial with Java | Part-III

Selenium with Java Tutorial
LT Video

How To Automate Email Testing 📧| Selenium 4 Tutorial with Java | Part-II

Selenium with Java Tutorial
LT Video

How To Automate Signup Forms 📝| Selenium 4 Tutorial With Java | Part-I

Selenium with Java Tutorial