freeCourse Image for Exception Handling - An Art to Master

Exception Handling - An Art to Master

Beginner
6 Lessons
01h 41m

Whenever I was given a framework to assess candidates – I first see how the developer/automation tester has handled exceptions in the framework. If you are someone who throws exceptions to the caller or adds try/catch blocks to calm down the annoying IDE warnings – you should definitely watch this course. There are a lot of intricacies like Run Time Exceptions, Custom Exceptions, Try with resources construct, how exceptions are thrown to the caller, Top-level logging, Bottom Level Logging, Medium Level Logging, and their usages in Test Automation were discussed in detail

Start Watching

Course Content

6 Lessons · 01h 41m

01. Creating your own Exception

30m 49s

In this video, I have explained about how to create our own custom exceptions. Apart from this, I have also explained why try catch is not always a best approach. How Runtime Exception can help in solving the issues? How selenium developers have developed their own exception? How to customize the existing stack trace?

02. Catch me if you can - Exception Handling in Detail

25m 35s

In this video, I have explained about checked exception and unchecked exception , call stack or thread stack , exception propagation in detail. I have also explained about the problem with the current exception handling implementation in current framework.

04. How to handle exception in static block

11m 22s

In this video, I have explained how handling exception in static block differs from conventional methods. 1. Why we have to mandatorily use try catch block inside static blocks? 2. Can I throw a runtime exception inside try catch block? 3. How can I stop the execution where there is a exception in try catch inside static block? 4. System.exit() method usage 5. Can we consider about removing the static block itself?

05. Try with Resources and Selenium Framework

20m 08s

In this video I have covered on the below topics, 1. What is try catch finally blocks? 2. What is the problem with try catch finally blocks? 3. What is try with resources? 4. When we can use try with resources? 5. Is there any prerequisite to use try with resources? 6. How the exception handling mechanism of try with resources varies with try catch finally (optional) 7. Can we have multiple resources inside try with resources(optional) 8. What is the change happened in Java 9 for try with resources? (optional)

06. Key things to remember - Exception Handling

08m 32s

In this video , I spoke in brief about the do's and dont's of exception handling. I have also highlighted the below topics, 1. Perform final review of all the exception handled in the framework. 2. Analyze and amend changes if needed. 3. Summary of the exception handling techniques.

View All

What You Will Learn

  • What is Exception Handling and what are the impacts of not handling exceptions properly
  • What is Runtime Exception and how has the exception been thrown back to the caller
  • How to create custom exceptions for your framework
  • Try with Resources construct and reading Property files using it
  • Handling exception in Static Block
  • When to throw an Exception and when to consolidate an Exception before throwing it

Prerequisites

  • Basics of Java