Why Exception Handling is Crucial in Automation | Selenium, Java, Python

GeeksforGeeks · Beginner ·☁️ DevOps & Cloud ·1y ago

Key Takeaways

Exception handling in automation testing using Selenium, Java, and Python, covering try-catch blocks, custom exceptions, error logging, and recovery mechanisms

Full Transcript

Hello. Hello. Uh, I hope you are able to hear me now. Hello I hope you are able to hear me now. Okay. So, uh since uh I have got a notification that you are able to hear me. So, let's start our topic. So, today's topic is uh all about exception handling. Uh Hello. Hello. Hello. Hello. Hello. I hope you are able to hear me perfectly now. So, let's uh start again. So, probably uh let's start from uh starting. I hope you are not able to hear me. uh let me know which uh which last topic you have uh heard so we can uh start it again. So let's start from uh beginning. So so let's say uh so the topic uh for today is Start thinking. Okay, cool. So, are you are able to hear me? Then uh let's get started again. So, the topic here uh for today's lecture is all about the exception handling for an automation. So, uh what does it exception handlings uh look like? So an exception is unwanted or you can say event that is occurring during an flow of a program. So let's say uh let's say uh you are doing a uh sort of thing for example you are traveling from uh a location to b location uh for example your school to office let's say this is what you are trying to do. So uh let's say uh you are uh traveling from cycle using A to B location. So uh you can see in this uh let's say there are some traffic jam during you know uh a flow or let's say there was uh some road breakage was happening during the flow. So uh to handle those exceptions we have or you can say this is known as unwanted thing that is happening during an actual server program. So to handle those this is known as exception handling look like. So there are two different approaches through which uh things were working for fine. So first is checked exception and second is a unchecked exceptions. So the checked exceptions are those exceptions that is handled already by the compiler. For example, let's say uh you are doing a flow. For example, uh you are handling a file means you are reading a file from one one of the location in your program. Selenium or the Java has already provided you a way which can tell you that this flow or code or this flow will might occur some errors. For example, uh file not found exceptions that that can occur. Similarly uh IO exception for example you are doing a SQL SQL uh queries that you want to do. So SQL exceptions might get thrown to you. So we can handle those exception by either a keywords which is provided by the Java. So what are those keywords that we are going to understand similarly but uh there are things that is during an runtime. For example, you are dividing a number between divided by 0. for example 10 divided by 0 which is not correct right uh as per mathematics it will reach out to the infinity so these exceptions are known as ar uh sorry unchecked exceptions so let's say you are have an array of length 10 and you want want to enter at line number 11 for example index number 15 or 12 you are wanted to enter so it will throw us array index b of exceptions similarly you are assigning some null value to a string string or a class reference or you can say class instance. So this will throw us a null pointer exception. So these are the unchecked exception that is occurring during a runtime. So to handle those exceptions we have a keywords in exceptions. What are those exceptions? First is try then catch then finally then throw and then throws. So these are the keywords which is provided by the Java to handle sort of things. So uh how we can do that? Right. So let's take an example with a more knowledge to understand the logic. You can see I have created one class which is named as demo demo exception lection number 9 package and we have created a main method inside that. Let's say you are a number which is a divided by 10 divided by 0. So this is the uh thing that I want to do. So let's say I have wants to print line after exception. So this is what uh you wants to do. Okay. So let's uh try to execute the flow and check the result. You can see uh this is causing an arithmetic exception means divided by zero. And this line line after exception is not printing. That means during an execution of a program the program holds. There is a exceptions occurred and we haven't handled those exceptions. That's why line number 10 will not execute it. So to handle these things the Java has provided you an approach which is known as exception handling. What are those approaches? So let's try to understand the first block which is a try block. So the try block means the code which might occur an exception. So we will write those code inside the T block. Now to handle those exceptions there is a class or there's a functions which is known as catch functions that is used for it. So catch those exceptions. Let's say I have printed out exception occurred during a flow. You can see by using a try at a catch block I have redundant the code means uh checked the exceptions that it might occurs. So let's uh try to execute the same and check the output of the program. How does it look like? You can see uh I have this in this phase the exception occurred and then it will move to the catch block. After the catch block you can see exceptions occurred during a flow is being printed. Then after we already have handled the exceptions still the program doesn't hold up it is printing this line means the flow is going till at the end of the program. So this is how the exception is occurred. This is known as single exception handling. But let's say you wants to do a multiple exception handling. So we can enter multiple exception. Let's say this is occurring a arithmetic exception. So this can handle as well. We can write multiple catch. But there is a one catch here such that we needs to enter the child of a catch above. For example, exception is a parent class of all the exceptions. So automatically this will comes at the bottom on the catching above always comes the child one. So this is what you needs to know about it. So let's uh check what does it output looks like. Let's say uh you can see still it is throwing a arithmetic exception that's why it is still going with this exception since since this we already have catch the exception this catch will not work so this exception or instead of this let's say make it as like this so it will throw us a better output you can see arithmetic exceptions occurred during a flow and then this block will not work because We already have handled the exceptions. So that's why it will printing the line number 21. So this is the code that you need to know understand about the exception handling. So we have so far understand the try block catch block. Now we needs to understand the finally block. How does the finally block look like? So uh what does the finally block look like? So let's say uh I wanted to do like this. Finally code is here. So let's say uh uh you can see this will occur exception which is uh a try catch block then this catch will work at the end. This finally will also work whether exception occurred whether exception not occurred. So let's check the output and we will get through the program and we will understand what I'm trying to say. So you already understand that this will throw an exception which is arithmetic exception. We have catched the exceptions. So this block will execute. So that means arithmetic occurred during a flow will throw us. Then you can see finally block still executing. See finally code is here at the end output is being thrown to you which is a line after code exception is still been thrown to you. What if the exception won't occur? Let's say instead of 10 divided by 0 let's say I will mark it as two. So what does it throw? So it will throw this thing. You can see finally code is here and since we the exception won't occur the catch block will not work only the finally block and this code will execute. So this is known as a finally block. So we have understood three different keywords in the Java to handle those exceptions. First is try, second is catch, third is finally. So uh let's move on to some more knowledge about the programs. So let's say I wanted to throw some exceptions after catching the same. So throw keyword this. So throw keyword is used to throw an exceptions only. So 40p. So give me one sec guys. Hello just give me one sec. That is butter. But butter is butter. Hello. Hello. Yeah. So, let's uh start it again. So, uh where was I? We were at uh finally block and we have understood the mean we need to understand the throw word keywords. So, the throw keywords will throw an exception nothing more than that. Whenever you are throw wants to throw an exception from your own then throw keywords will be used. So let's uh use this and try to run the same. You can see we are throwing an exception since the exception has been occurred. So this exception is being triggering to you. I have intentionally thrown the runtime exceptions. So that why it is throwing a runtime exceptions to us. So this is how the throw keywords is used to throw an exception manually. For example, uh let's take an example from a voting system. So let's say uh you have developed uh one exception which name exceptions and you wanted to throw that exceptions uh for example less than 18 years the exception will thrown to you. So you can use the throw keywords and print those exceptions. So this is how the throw keywords look like. So now we will understand about the throws later on. So before moving on to that, let's understand the automation perspective why we have deals or why we need to understand this. So in the automations let's say uh during and flow of exceptions or fling during a flow of a program you will see some exceptions such as uh no such element exceptions means the element was not present to the web page. Stale element the element uh is updated or uh the element is not referenced correctly. Time out exceptions that you have wait till n number of time. For example, the page is loaded nearly 10 seconds but you have started finding web elements at page number at the time number three. So still page is not loaded but the element is not found. So that's why time exception withdrawn means you have reached the limit. The element is uh at is showing on the index number 15 but you have it is still not appearing on the web page. Similarly in element not interactable for example the element is disabled on the web page like clickable visible these are the things that can be used for that part. Similarly if you have uh closed the web web driver automatically and uh and try to open the website so you will see web driver exceptions. So these are the common element exceptions which is thrown to you uh in during a selenium code executions. To handle those exceptions we have already provided by the Java strike catch block. So we will use those exceptions handling in our program. So let's understand with example for more knowledge about it. So let's say I have opened instagram.com. So this is the website. This is the web element I need to find. Let's say this is the web element which is this one. Okay. Submit is the element that I want to do. For example, login button. I wants to check the same. So let's create one class selenium exception handling. This is what uh you want to do. Let's say uh web driver manager dot uh let's say web driver manager dot is not working. Let me rebuild. Okay. So, let's delete the first and rebuild the module. Okay. So uh let's create one class which is a selenium check handling and uh inside that main method let's try to execute the programs. Let's say I have a web driver manager chromedriver dot setup. So uh this by this we don't need to provide uh the chromedriver exe files. uh when we understand the selenium you will uh get to know about all those. So let's wait uh till the things that we needs to do. So by this uh by these two lines the chrome rival instance will open. After the it's opened there is a functions which is known as get functions through which we needs to provide a URL. After providing a URL this website is being loaded on the web page nothing more than that. So let's say driver dot manage dot windows domaximize by this method we are maximizing the browser nothing more than that. So these three lines uh we will cover when we have a sessions about the seleniums later on and we need to discuss on this uh with the team. So let's uh understand we have so let's say I wanted to find this web element and I wanted to click this web element this is what the action we wants to do. So first we need to find this web element. There is a functions which is known as find element which is provided by the web driver. So driver dot find element by dot let's say id. I have intentionally added a incorrect ID. Okay. So this is the web element or let's say uh login button. This is the web element I have created. Using this web element, I can click on it. This is the uh thing that I want to do. Let's try to execute the same and check the flow of a program. At the end, I am quitting the browser. This is what I'm trying to do. Let's execute the same and uh check the result. As you can see the Chrome browser gets opened. Instagram dot gets opened here. Let's uh open this the execution flow. You can see the chromedriver still remain open and we have seen one exceptions which is this exception means no such element exception is being thrown to you. So this is how the seleniums look like the exceptions which occurring during an entire flow is we needs to handle those exceptions. So we had to know about the try catch block why we had to do. So how we can handle those exceptions same ideology that what we are trying to do the error or the code where the exceptions might occur we needs to write in the try catch block. So we already have handled the exception using try. Now we can catch the exception. How we can catch the exception? So we have executed this. So this is the exception that it can occur. Okay, let's import that class. You can see system.out.print and login button not found. If the element was not found, I will catch that no element exception and will throw this message. This is what I'm trying to do. Then after we already handle the exception, the web browser gets closed up. This is what I'm trying to do. Let's execute the same and check if that is working fine or not. See uh web browser gets opened. As you can see the exceptions was occurring to us. Exception was occurring. Still you can see it will throw us a line means the exception handled means line this line will be thrown to you. And also the Chrome browser which was that was above one. So the chrome browser which remains opened has been closed as well. So this is how we have handled that exceptions during an occurrence or a program. Similarly you can do one more uh thing. We can handle this using a finally as well. So let's say this driver.quit we are handling in the try catch block and print like this test execution completed. So this is what I'm going to do. So whenever the exception occur we are handle the exception and also we are executing the finally block where it will show us this message and quit the browser. So let's try to execute the program and what does it say. So you can see chrome browser gets open maximizing instagram.com web page note element found and you can see the chrome browser also gets open up and the message that we have put in the catch exception and the finally block is also working fine. This is how we are handling the try catch or finally in the selenium. This is how we are actually doing in the selenium code. We are handling the codes using a try catch block. So I hope you are able to understand interact with the real time log about the program we have so far understand about it. So uh let's understand more about new things. So we already know about multiple catch blocks. We can write a multiple catch like this. Instead of this we can also write this. So this is how we can do that as well. Similarly method let's say uh you after uh element got found for example element not found exception occur we wants to take a snapshot and store it somewhere this is the utility that you wants to do whenever there is exceptions has been occurred during a program and execution of a program how we can do that we can do that using a utility class needs to be created so let's uh create one utility class and use those class from our own and use those to find those web element. Let's uh create the logic. So let me uh remove all those unnecessary code. So far we have only uh maximizing the browser. Instagram.com gets loaded. Nothing more than that inside this main method. So uh let's create some utility methods like clicking of elements and then taking a screenshot whenever there is exception occur during a uh element clickable. This is what I was trying trying to do. So, uh let's say public void take screenshot. This is the function name I have created. Inside that it is accepting a web driver and file name that we wants to create file. Let's say I have created file source take screenshot driver get screenshot as output do file. So uh we will handle uh so this is the pre-existing code for taking a screenshot. Don't bother much about it. uh it's a file handling code where we are uh taking a screenshot and storing it uh some files. So I will be using src dot to path home path dot get file name plus dotpng. So uh it is basically uh what we're trying to do. You can see this exceptions or this function copy function will throw this exception IO exceptions. So we needs to handle by two different approach. We can either write this in a try catch or we can throw the exception by this function. We can do any approach. Let's go with the try catch block first to show you since we have catch the exception like this. And we will bring the screenshot captured failed. Okay. If the exceptions occur during a screenshot capturing, it will throw this exception. Nothing more than that. This can handle like this as well. Also, there there is one more approach. How we can do that? just add throws keyword after the uh function and provide the exceptions that it might can occur. For example, it can occur IO exceptions. So without providing the try catch block, we can handle that exceptions. Whenever someone is using that function take screenshot, they needs to done a try catch block automatically. means they needs to either use a try catch log and also they can also use again throw IO exception that that can be altered as well. I hope you are able to understand uh so far it's these lines of code only taking a snapshots and storing the file name whatever we are providing nothing more than that. So let's create one function as well uh which is clicking a element like we done here. So, so by locator web driver driver driver dot find element by dot instead of by let's take it as locator dot click. You can see this block whenever there is a exception occur we are taking a snapshot. So let's make it like this catch exception let's say and inside that we are calling this take screenshot function and provide the file name. You can click a file name as well. For example, error snapshot. This is the file name that I wanted to create. You can see we have use a throw keyword. So we can either add exceptions like this or we can write a try catch block directly here. So we don't need to throw it here. We can do either. So instead of throwing all the times we can handle from here only try catch exception e and inside that let's print screenshot captured failed. And similarly we also printing element clicking failed and after the element clicking failed it will goes to the take screenshot function and then take a screenshot on the web page that whatever it gets opened. So this is what I'm trying to do with this utility. So we have created two different utilities. First is clicking the web element that will accept two parameters. First is locator. Second is driver. Similarly, we have created one more utility which is named the tech take screenshot. Whenever there is a exception occurred then we are calling those take screenshot and we have provided the file name it gets created. We have provided this file name. So automatically it get created with the error screenshot dotpng file. It will create a image file that's more more like it. Okay. So we have handled two different screenshot utility by creating those two methods. So now so we already understand use of throws with the help of these two examples. So let's move on to the actual code that we are trying to execute now. So so let's uh understand the logic. You have created two different utilities. First is clicking element and second is a take screenshot. Correct? So we already have opened the web brows uh website till now. Now I wants to click on the element. We need to provide a element. So how we can do that by dot id let's say in intentionally I providing a incorrect id since it is returning a bylocator. You can see we can store into a by variable. Let's say login button. So we have stored one variable as a login button. So directly I can provide it here. So if I want to call this click element function, how we can do that? We can have a two approach. First we can make this as static one or there is one more approach. We can create a reference variable of a class. So the class is selenium object. Let's say I have created a reference variable as OBJ is equal to new. Now we have know this OBJ is able to access this click element also he is able to access this take screenshot. So but we wants to do what we wants to clicker element right. So obj dot click element. What are the parameter that we need to provide? First is locator and second is driver we already have find the locator. This is the locator we have. Second this is the locator we have and second is driver. We already the driver you by this logic you can see we have clicked the web element and already handle those exception if the element occurred and whenever the exception occurred we are calling a sn screenshot and also it is taking a snapshot as well. This is what happening. Let's try to execute the same and check the result. You can see there is no such file has been right now in our project. Right? So let's take a snapshot and check. I'm trying to execute the program now. I hope you are able to understand so far. You can see the execution has been occurred. You can see element clicking failed because the exception is element is not present on the web page. And now you can see error snapshot. Whatever the file name I have provided PNG extension has been created and you can see it has taken the snapshot as well. Let's open the file in explorer. This is the file. You can see it has taken the snapshot on the web page. So this is the end of the program. we have understand about it and that's all for uh best practices use custom messages in the catch block like I did in this I have added a custom messages like this similarly taking a scratch for debugging that what we already have done and if uh there are some new things like uh reports adding logs adding so that can also be used try catch block for the critical flows like we did and the clicking of element is a critical flow that can occur Finally for just cleaning clean cleaning up you can see the chrome browser still remain open. We can add one finally block if we want uh whenever there is a exception occur like this driver dot quit can occur then whenever the element was not able to find automatically this will close the browser. Summary we already have understanded about it. The stable automation we see checked and then checked we have seen we have used the try catch block. Similarly we have understood one exception which is not some of element find exception in the selenium itself only. Similarly for one homework is for that launch a browser open some website try finding a missing element and uh handle the no such element exception and log it take screenshot in the cash flow.

Original Description

Exception handling is a critical skill in automation testing that ensures your scripts run smoothly, even when unexpected issues arise. In this video, we dive into the importance of exception handling in automation, covering concepts like try-catch blocks, custom exceptions, error logging, and recovery scenarios. Whether you're using Selenium, Java, Python, or any other test automation framework, understanding how to manage runtime errors can save hours of debugging and help build more reliable test scripts. Perfect for beginners and intermediate testers looking to improve their automation skills and build robust, production-ready frameworks. Get all important links here: 🔗 Visit website: https://geeksforgeeks.org/ Explore Premium LIVE, Online & Offline Courses : https://geeksforgeeks.org/courses/ Solve POTD: https://www.geeksforgeeks.org/problem-of-the-day Ongoing contests, hackathons and events: https://www.geeksforgeeks.org/events Follow us for more fun, knowledge and resources, join us on our social handles: 📱Take GeeksforGeeks everywhere in your pockets! Don't forget to download our official app: https://geeksforgeeksapp.page.link/gfg-app 💬 X- https://x.com/geeksforgeeks 🧑‍💼 LinkedIn- https://www.linkedin.com/company/geeksforgeeks 📷 Instagram- https://www.instagram.com/geeks_for_geeks/?hl=en 💌 Telegram- https://t.me/s/geeksforgeeks_official 📌 Pinterest: https://in.pinterest.com/geeks_for_geeks/ Also, Subscribe if you haven't already! :) #ExceptionHandling #AutomationTesting #SeleniumJava #SeleniumPython #AutomationFramework #ErrorHandling #TestingBestPractices #TryCatch #CustomExceptions #TestAutomation #QAEngineer #JavaExceptions #PythonTryExcept #AutomationScripting #DebuggingTips #GeeksforGeeks #Learntocode #GfG
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from GeeksforGeeks · GeeksforGeeks · 0 of 60

← Previous Next →
1 How I got into Walmart | Shailesh Sharma
How I got into Walmart | Shailesh Sharma
GeeksforGeeks
2 Upgrade yourself In 29 Days | GeeksforGeeks
Upgrade yourself In 29 Days | GeeksforGeeks
GeeksforGeeks
3 Learn AWS Fundamentals For Free
Learn AWS Fundamentals For Free
GeeksforGeeks
4 Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
Conversation With Young Achievers | Meet the winners of Bi-Wizard Coding Contest | GeeksforGeeks
GeeksforGeeks
5 Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
Meet The Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
6 Interview Prep Strategies | PayPal
Interview Prep Strategies | PayPal
GeeksforGeeks
7 OLX Interview Preparation Strategies | Hukam Singh
OLX Interview Preparation Strategies | Hukam Singh
GeeksforGeeks
8 Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
Meet Some More Winners Of Bi-Wizard Coding Contests | GeeksforGeeks
GeeksforGeeks
9 Live Mock DSA
Live Mock DSA
GeeksforGeeks
10 Microsoft Azure For Absolute Beginners
Microsoft Azure For Absolute Beginners
GeeksforGeeks
11 Python for Data Science | Data Science Master Bootcamp | Arpit Jain
Python for Data Science | Data Science Master Bootcamp | Arpit Jain
GeeksforGeeks
12 Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
Getting Started with Data Analysis | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
13 How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
How to prepare theory subjects for SDE interviews | Geeks Summer Carnival 2022
GeeksforGeeks
14 Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
Get Your Tickets To The Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
15 TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
TED Talk Data Analysis Project | Data Science Master Bootcamp | Ashish Jangra
GeeksforGeeks
16 How I Secured AIR 9 in GATE'22 |  Tushar
How I Secured AIR 9 in GATE'22 | Tushar
GeeksforGeeks
17 Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
Learn Java Backend Development | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
18 How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
How to Recognize which Data Structure to use in a question | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
19 Learn Data Structures and Algorithms | GeeksforGeeks
Learn Data Structures and Algorithms | GeeksforGeeks
GeeksforGeeks
20 Interview experience at Flipkart | GeeksforGeeks
Interview experience at Flipkart | GeeksforGeeks
GeeksforGeeks
21 Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
Lets Prepare for GATE'23 the Right Way | Sakshi Singhal | GeekSummerCarnival
GeeksforGeeks
22 Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
Highest Paying Jobs in 2022 | Ishan Sharma | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
23 Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
Geeks Summer Carnival 2022 | 5th April- 11th April | GeeksforGeeks
GeeksforGeeks
24 Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
Preparing for SDE interviews | Soham Mukherjee | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
25 Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
Full Stack Development with React & Node | Utkarsh Malik | Geeks Summer Carnival | GeeksforGeeks
GeeksforGeeks
26 Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
Introduction to Open Source and Roadmap to GSOC 2022 | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
27 Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
Web Scraping in Action | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
28 Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
Getting Hired at BITCS via GfG Job Portal | Get Hired With GeeksforGeeks
GeeksforGeeks
29 How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
How to build a faster landing Page | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
30 Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
Geeks Summer Carnival | 5th To 11th April, 2022 | GeeksforGeeks
GeeksforGeeks
31 How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
How to get ideas for Startup | Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
32 Journey from Tier 3 to JusPay | GeeksforGeeks
Journey from Tier 3 to JusPay | GeeksforGeeks
GeeksforGeeks
33 Geeks Summer Carnival 2022 | GeeksforGeeks
Geeks Summer Carnival 2022 | GeeksforGeeks
GeeksforGeeks
34 Dispelling Myths and Pre conceptions of Programming Languages
Dispelling Myths and Pre conceptions of Programming Languages
GeeksforGeeks
35 Must Do System Design Questions
Must Do System Design Questions
GeeksforGeeks
36 Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
Understanding Sorting Techniques in an hour | Keerti Purswani | Geeks Summer Carnival
GeeksforGeeks
37 Get Hired at NEC | Job-A-Thon 8
Get Hired at NEC | Job-A-Thon 8
GeeksforGeeks
38 Journey from Tier 3 college to Microsoft | GeeksforGeeks
Journey from Tier 3 college to Microsoft | GeeksforGeeks
GeeksforGeeks
39 Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
Get Hired with GeeksforGeeks at SuperK | Job A Thon 8
GeeksforGeeks
40 GeeksforGeeks: Redesigned
GeeksforGeeks: Redesigned
GeeksforGeeks
41 From Tier 3 to cracking multiple interviews | GeeksforGeeks
From Tier 3 to cracking multiple interviews | GeeksforGeeks
GeeksforGeeks
42 Live Mock DSA
Live Mock DSA
GeeksforGeeks
43 Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
Youtube Data Analysis | Ashish Jangra | GeeksforGeeks
GeeksforGeeks
44 DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
DSA Self-Paced Course Preview | Sandeep Jain | GeeksforGeeks
GeeksforGeeks
45 GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GATE Live Classes | Prepare for GATE CS 2023 | GeeksforGeeks
GeeksforGeeks
46 Journey from JIIT to Adobe
Journey from JIIT to Adobe
GeeksforGeeks
47 Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
Life Is Unfair Ft. Shonty badmash | LIVE Discord Session | A GeeksforGeeks Exclusive
GeeksforGeeks
48 Interview Experience at Google | Tech Dose
Interview Experience at Google | Tech Dose
GeeksforGeeks
49 Live Mock DSA
Live Mock DSA
GeeksforGeeks
50 Interview Experience @ Amazon | GeeksforGeeks
Interview Experience @ Amazon | GeeksforGeeks
GeeksforGeeks
51 My journey through the tech world from India to US | Vidushi | GeeksforGeeks
My journey through the tech world from India to US | Vidushi | GeeksforGeeks
GeeksforGeeks
52 Complete Interview Preparation Course | GeeksforGeeks
Complete Interview Preparation Course | GeeksforGeeks
GeeksforGeeks
53 Live Mock DSA
Live Mock DSA
GeeksforGeeks
54 Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
Getting Hired at FiftyFive Technologies | Job-a-thon 9.0
GeeksforGeeks
55 GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GFG Karlo, Ho Jayega | GeeksforGeeks ft. Khaleel Ahmed
GeeksforGeeks
56 How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
How I got job offers from 2 big companies : Arcesium & Microsoft | GeeksforGeeks
GeeksforGeeks
57 LINUX for Beginners | GFG x Itversity
LINUX for Beginners | GFG x Itversity
GeeksforGeeks
58 My interview experience at Walmart | GeeksforGeeks
My interview experience at Walmart | GeeksforGeeks
GeeksforGeeks
59 Get Hired at Speckyfox
Get Hired at Speckyfox
GeeksforGeeks
60 Live Mock DSA
Live Mock DSA
GeeksforGeeks

This video teaches the importance of exception handling in automation testing, covering key concepts and techniques for ensuring smooth script execution. Viewers will learn how to handle unexpected issues and errors in their automation scripts using Selenium, Java, and Python.

Key Takeaways
  1. Understand the importance of exception handling in automation testing
  2. Learn how to use try-catch blocks for error handling
  3. Create custom exceptions for specific error scenarios
  4. Implement error logging and recovery mechanisms
  5. Practice exception handling in automation scripts using Selenium, Java, and Python
💡 Exception handling is crucial in automation testing to ensure smooth script execution and prevent errors from causing script failures.

Related Reads

📰
Slack Built Its Own EC2 Platform. Buying One Was the Harder Question.
Learn how Slack built its own EC2 platform and the considerations behind the build vs buy decision
Medium · DevOps
📰
Engineering Culture Starts with Version Control — Building Trust, Ownership, and Collaboration at…
Learn how version control systems can foster a culture of trust, ownership, and collaboration in engineering teams
Medium · DevOps
📰
Not Every Workload Belongs on a Free Server: Red Flags and Exit Criteria
Learn when to avoid using free servers for workloads and how to identify red flags and exit criteria
Dev.to · Casey Sun
📰
Reviewing a PR You Can't Run Locally: A Reproducible Free-Tier Loop
Learn to review a PR without running it locally using a reproducible free-tier loop, ensuring efficient open-source maintenance
Dev.to · Blake Yang
Up next
Containers vs Virtual Machines
KodeKloud
Watch →