Latest post from this blog

Test Scenarios vs. Test Cases: Understanding the Basics

What Are Test Scenarios Test scenarios represent high-level ideas or conditions that need to be validated to ensure the application works as expected. They provide a broader perspective and are typically used during the test planning phase. Purpose: To capture the "what to test" without going into granular details. Example of a Test Scenario: Verify that a user can successfully log in to the application using valid credentials. Verify the behavior of the login page when invalid credentials are entered. Verify the application behavior when the login button is clicked without entering any credentials. What Are Test Cases Test cases are detailed documents that define the specific steps to execute a test. They cover inputs, execution steps, expected results, and actual outcomes. Purpose: To guide the tester step-by-step on "how to test." Example of a Test Case (for the first scenario): Test Case ID TC_01_Login_Valid_Credentials Test Scenario Verify user login with val...

Common Exception in Selenium

Introduction
Selenium automation testing can throw several types of exceptions due to various issues during the execution of test scripts. Here are some of the most common exceptions encountered in Selenium.

1. WebDriverException is a base class for all exceptions thrown by the WebDriver API. 

2. StaleElementReferenceException is thrown when trying to interact with an element no longer attached to the DOM (Document Object Model). This can happen if the element has been deleted or the page has been refreshed since the element was located. "stale" is often used to refer to something that is no longer fresh or current.

3. TimeoutException is thrown when a command times out. This can occur if the page takes too long to load or if an element is not found within the specified time period.

4. UnreachableBrowserException is thrown when a connection to a web browser cannot be established.

5. NoSuchElementException is thrown when it cannot find an element on the page that it is trying to interact with.

6. NoSuchFrameException is thrown when it cannot find the frame that it is trying to switch to. 

7. NoSuchWindowException is thrown when it cannot find the window that it is trying to switch to. 

8. NoAlertPresentException is thrown when trying to switch to an alert that is not present.

9. ElementClickInterceptedException is thrown when an element that a program is trying to click is blocked from being clicked. This can happen if another element on the page is covering the element that the program is trying to click on, or if the element is obscured by a modal dialog or pop-up window.

10. InvalidElementStateException is thrown when an operation is attempted on an element that is not in a valid state for the operation. For example, if you try to click a button on a webpage using Selenium, but the button is not visible or is disabled.

11. SessionNotFoundException Occurs when WebDriver tries to perform an action after the browser session has ended or is invalid.

12. ElementNotInteractableException Thrown when an element is present and visible in the DOM but cannot be interacted with (e.g., a disabled button or an input field).

13. ElementNotVisibleException occurs when an element is present in the DOM but not visible on the page, so Selenium cannot interact with it.

Comments

Popular posts from this blog

Test Scenarios vs. Test Cases: Understanding the Basics

Handling Shadow DOM in Selenium WebDriver

Handling HTTPS Websites and SSL Certificate Errors in Selenium

Normalize-space Function In Xpath