Selenium_Java_Interview_Questions
Selenium_Java_Interview_Questions
Selenium is an open-source automation testing tool used to automate web applications. Its main
components are:
- Selenium Grid: Allows parallel execution of tests across different browsers and systems.
- **Limitations:** Cannot test desktop or mobile apps directly, limited support for handling captchas
- WebDriver interacts directly with the browser, while Selenium RC requires a server.
Yes, by using dynamic locators like XPath or CSS Selectors and applying waits (e.g., explicit or
fluent wait).
- `findElements()`: Returns a list of all matching elements or an empty list if none are found.
- ID
- Name
- Class Name
- Tag Name
- XPath
- CSS Selector
- Link Text
Using the `Select` class, which provides methods like `selectByValue()`, `selectByVisibleText()`, and
`selectByIndex()`.
9. **What is an implicit wait in Selenium, and how is it different from an explicit wait?**
- **Implicit Wait:** Sets a global wait time for all elements. Example:
`driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS)`.
- **Explicit Wait:** Waits for specific conditions. Example: `WebDriverWait` with conditions like
`elementToBeClickable()`.
```java
```