Selenium-Related
What is selenium?
Selenium is a library, which has necessary classes and methods to automate user actions on the browser. Like navigating, clicking, entering form etc.,
What are the different types of locators in Selenium?
In Selenium locators are the way to identify elements inside a web page.
Locator | Example |
Id |
|
Name |
|
Tag name |
|
Link text |
|
Partial link text |
|
CSS selector |
|
XPath |
|
When should I use Selenium Grid?
Selenium Grid is used to run the same scripts in multiple environments like different OS, Browsers etc.,
What are Implicit and Explicit Waits?
Implicit wait:
As per selenium documentation "An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available".
We can consider it as default wait during the script execution, and it is defined on the WebDriver object.
Defining implicit wait:
Explicit Wait:
Explicit wait is halting the execution for certain amount of time while we are waiting for a condition. Some commonly encountered conditions are defined in ExpectedConditions
class of selenium library.
With the help of ExplicitWait and ExpectedConditions we can achive waiting for specific conditions.
There are 2 ways we can use explicit wait we can use in our code
WebDriverWait
FluentWait:
Fluent wait is bit advanced and gives other features where we can specify polling frequency, ignore exception etc.,
Last updated