Top 10 Pro Level Selenium Automation Interview Questions 2
Selenium Automation Interview Questions for 4+ years of experience.
Q1 - How to navigate to 3rd window to 7th window in selenium?
Answer - Code example:
Q2 - How to read the text of a cell in a dynamic web table?
Answer - We can read text from a dynamic web table by preparing dynamic xpath of table at runtime.
Q3 - How to check the text is selected or not on page?
Q4 - How to handle ajax call in Selenium?
Answer - When we do Google search and a list of options matching to our keyword displayed on it's own without refreshing the page, is an example of ajax search. We can handle ajax elements using Explicit Wait in Selenium.
Q5 - How to handle synchronization in selenium?
Q6 - What types of waits we have and which is best in Selenium?
Answer - There are three types of wait in Selenium:
Q7 - Syntax for both implicit and explicit wait?
Answer - Code example:
Q9 - How to implement oops concepts in selenium?
Q10 - What are the different types of automation frameworks?
Answer -
You can answer the questions in comments to help others. We will showcase the best answers on our website with user's name.
For list of Selenium tutorials click here: Selenium Webdriver Tutorials Series
Q1 - How to navigate to 3rd window to 7th window in selenium?
Answer - Code example:
Case 1:
// Create a Set and store all window handle ids in it
Set AllWindowHandles = driver.getWindowHandles();
String window1 = (String) AllWindowHandles.toArray()[0];
String window2 = (String) AllWindowHandles.toArray()[1];
// Switch to window with id 2
driver.switchTo().window(window2);
Case 2 :
/* Moving Between all Windows
*/
for (String handle : driver.getWindowHandles()) {
driver.switchTo().window(handle);
}
Q2 - How to read the text of a cell in a dynamic web table?
Answer - We can read text from a dynamic web table by preparing dynamic xpath of table at runtime.
Read details - Handle Dynamic Table
Q4 - How to handle ajax call in Selenium?
Answer - When we do Google search and a list of options matching to our keyword displayed on it's own without refreshing the page, is an example of ajax search. We can handle ajax elements using Explicit Wait in Selenium.
Read details - Automating Google Search using Explicit Wait
Q6 - What types of waits we have and which is best in Selenium?
Answer - There are three types of wait in Selenium:
- Implicit Wait
- Explicit Wait
- Fluent Wait
Q7 - Syntax for both implicit and explicit wait?
Answer - Code example:
// Implicit wait - Set wait of 10 seconds driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); // Explicit Wait WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.alertIsPresent());
Q8 - Why we aren't recommended to use Thread.sleep() in selenium?
Q9 - How to implement oops concepts in selenium?
Q10 - What are the different types of automation frameworks?
Answer -
- Linear Framework
- Keyword Driven Framework
- Modular Framework
- Data Driven Framework
- Page Object Model
- Hybrid Framework
You can answer the questions in comments to help others. We will showcase the best answers on our website with user's name.
For list of Selenium tutorials click here: Selenium Webdriver Tutorials Series
Guest Author
Barri Siva
Quality Engineer II
sivaeswar111@gmail.com
Subscribe FB Group Techlistic.comBarri Siva
Quality Engineer II
sivaeswar111@gmail.com
Join Telegram channel at https://t.me/techlistic
Feel free to ask queries or share your thoughts in comments or email me.
Follow Us
Feel free to ask queries or share your thoughts in comments or email us.
do you have answer, ? pls share iftekerahmed@gmail.com
ReplyDeleteDo you have Answers of all these question. Please share
ReplyDeleteswapnil.bodade88@gmail.com
Kindly answers for these questions. Could you send them to my mail? It's hareesharunoday@gmail.com
ReplyDelete