What is an Exception?
An exception is an event that interrupts the execution of the program without giving the output. In simple words, any issue which stops your script in between the execution is an exception. When an exception occurs in the program then It halts the normal flow of the program and creates an object. The exception object contains a lot of debugging information such as method name, line number where the exception occurred and type of exception.
Common Type of Exceptions:
-
WebDriverException
When a code is not initializing the web driver or when the web driver performs actions right after closing the browser.
-
NoSuchElementException
When an element does not identify on the web page during the run time process.
-
ElementNotVisibleException
When a user tries to interact with an element that is hidden on the page. For Example, when a user tries to perform click action on the sub-heading in the drop-down list.
-
ElementNotSelectableException
When an element is present but disable and not clickable on the web page.
-
InvalidSelectorException
When a selected locator or selector does not return web element values. This exception occurs when a user does not select the web element and enters an invalid locator path.
-
NoAlertPresentException
When the web driver does not find any alert or switching to the invalid alert which is not present on the web page.
-
NoSuchFrameException
When the frame is not loaded on the web page or web driver switches to an invalid frame which is not present on the web page.
-
NoSuchWindowException
When the selected window is not loaded and the web driver is switching to the wrong window.
-
SessionNotFoundException
When session Id is not present and inactive in the given active session list.
-
StaleElementReferenceException
Stale means no longer. This exception occurs when a reference variable is no longer on the DOM page. This happens due to the following reasons:
- The current page has refresh before locating to element on the page.
- Element is removed from the page.
-
TimeoutException
When a selected command takes more time than the given time limit to return the value.
-
NoSuchAttributeException
When the attribute of an element is not finding on the web page.
-
JavascriptException
It usually happens when a command executed by a user fails. For Example, a user tries to execute the script with an unidentified variable.
-
ScreenshotException
When it is impossible or script fails to capture the selected screen.
A Windows 10 certification can help you prove your skills in the Microsoft Windows 10 operating system and it can improve your chances of getting hired. StudySection offers a Windows 10 certification exam for beginner level as well as professional level individuals in the Microsoft Windows 10 operating system.