Classification and Explanation of Selenium Exception
Posted By : Pratyush Kumar Singh | 25-Nov-2020
Introduction: During automation in Selenium, you can run into various exceptions and you may want to tackle them. Although exceptions are more easily fixable than bugs or errors as they will throw logical termination.
This article will provide you with a listing of common exceptions in Selenium also the cases during which they occur. But first, let us have a glance at some important information regarding the term “exception” in Selenium.
An exception is short for an exceptional event in Selenium. It refers to an incident, which occurs during the execution of a program, that disrupts the regular flow of the program’s instructions. An exception is additionally considered as a fault.
Also Read: The Significance of WebElement In Selenium
Classification of Selenium Exception
Selenium exceptions are classified into two types:
Checked Exceptions: Checked Exceptions are handled while the code is being written. These exceptions need to be manipulated before compiling the code, therefore, such exceptions are examined at the compile time.
Unchecked Exceptions: These exceptions propelled at run-time. Unchecked exceptions are more cataclysmic than the compile-time exception because it causes problems while running the Automation pack in headless.
Also Read: Difference Between Testing and Checking an Application
List of Common Exceptions in Selenium
- RemoteDriverServerException: This Selenium exception is thrown when the server doesn't respond thanks to the matter that the capabilities described aren't proper
- ScreenshotException: It is impossible to capture a screen.
- ScriptTimeoutException: Thrown when executeAsyncScript takes longer than the given deadline to return the worth.
- SessionNotCreatedException: A new session couldn't be successfully created.
- SessionNotFoundException: This exception occurs when the browser gets crashed or you accidentally quit the browser instance
- StaleElementReferenceException: This Selenium exception happens if the online element is detached from the present DOM.
- TimeoutException: This exception is thrown when there's not enough time for a command to be completed.
- UnableToCreateProfileException: You can open a browser with certain options using profiles, but sometimes a replacement version of the Selenium driver server or browser might not support the profiles.
- WebDriverException: This exception occurs only when Web-driver is performing an action while you closed the browser
Conclusion: “Exception” is the most heard phrase when you talk about programming, no matter which language you employ to write down codes. Therefore, I even have listed all kinds of exceptions in Selenium alongside their explanations. From here, you'll create robust and optimal codes in Selenium.
We, at Oodles Technologies, provide full-scale SaaS app development services that also include 360-degree quality assurance services. Our team of QA engineers holistically test your software application using the most advanced software testing tools like Selenium, JMeter, and Katalon Studio. Our software testing services are conducive to seamless run a web or mobile application across multiple platforms with minimal downtime or latency. For more information, contact us at [email protected].
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Pratyush Kumar Singh
Pratyush is a bright QA Engineer with skills in Manual Testing and always eager to learn. He has good ability to solve the problems and provide solutions.