Pages

Monday, 1 June 2020

Top 20 Selenium Webdriver Interview questions SET-2? Automation Testing-SDET Interview Preparation


Check Selenium-SDET-UIAutomation Questions set 21 to 30:
 
Check Selenium-SDET-UIAutomation Questions set 31 to 40:

 Question Set 31-40  

Check Selenium-SDET-UIAutomation Questions set 41-50:

Q&A Set 41-50

To check API related topics and interview tips check below and keep reading:

Most Asked API Question For SDET

Want to learn more? ...Check below link for more interview question:


11. How to handle alerts and popups in selenium?

•    driver.switchTO().alert.accept() — to accept the alert box
•    driver.switchTO().alert.dismiss() — to cancel the alert box

12. How to retrive alert pop up message in selenium?

•    driver.switchTO().alert.getText() — to retrieve the alert message

13. How to send data to alert box in Selenium?

•    driver.switchTO().alert.sendKeys(“Text”) — to send data to the alert box

14. How to switch frames in selenium?

•    driver.switchTo.frame(int frameNumber) — mentioning the frame index number, the Driver will switch to that specific frame
•    driver.switchTo.frame(string frameNameOrID) — mentioning the frame element or ID, the Driver will switch to that specific frame
•    driver.switchTo.frame(WebElement frameElement) — mentioning the frame web element, the Driver will switch to that specific frame

15. How to switch back to main window in frames?

•    driver.switchTo().defaultContent() — Switching back to the main window

*.What are the new features in Selenium 4? VERY IMP 

CLICK HERE FOR ANSWER


16. How to handle multiple windows and tabs in Selenium?

•    getWindowHandle() — used to retrieve the handle of the current page (a unique identifier)
•    getWindowHandles() — used to retrieve a set of handles of the all the pages available

17. How to switch between windows and tabs?
•    driver.switchTo().window(“windowName/handle”) — switch to a window

18. How to close the cureent browser window?

•    driver.close() — closes the current browser window

*. Which Source code management tool you have used and tell me some of the basic commands that you have used?

CLICK HERE FOR ANSWER

*. Have you worked on database side for fetching data to validate in selenium tests, if Yes then can you tell me some of the basic queries that you have used in day to day work?

CLICK HERE FOR TOP 11 SQL QUERY

*.  How to launch batch file from Selenium WebDriver?

 Process batch = Runtime.getRuntime.exec("path of the batch file");

*. How to run selenium test from command line?

java -classpath ".;selenium-server-standalone-2.33.0.jar" SampleClass

*. What is the name of the super interface of the Webdriver?

Ans: SearchContext.

*. Explain some of the strategy you have followed while using xpath?

Click here for answer


19. How to handle Implicit wait?
Used to wait for a certain amount of time before throwing an exception
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

20. How to handle Explicit wait?
Used to wait until a certain condition occurs before executing the code.
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.presenceOfElementLocated(By.name("login")));

Top Interview question on Selenium Set-1 can be found below:

21. How to read properties file and fetch data ? Code to read common.properties file in framework?

 

*************************************************

Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session

TRANING VIDEOS AVAILABLE with Live Doubt Session @4500/-(course-1 below,API TRaining Videos With ClassNotes and Coding Set) and 6500/- (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122
CLICK HERE FOR COURSE CONTENT

Difference between getwindowHandle and getwindowHandles ?

ANS:
driver.getWindowHandle() return a String of alphanumeric window handle and is mainly used to get the window handle of the current window.
driver.getWindowHandles() return a set of window handles and is mainly used to get the window handle of all the current windows.


3. How to handle popup and alerts in selenium?

ANS:  

Alert alert = driver.switchTo().alert();

alert.accept(); //it will click on "ok"

alert.dismiss();  //it will click on "cancel"

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions

2 comments:

  1. Your blog is amazing and I enjoyed reading this blog. Your way of explaining is very effective, which will solve the problem of many people. I want you to keep bringing similar blogs for us in the future also. I want to thank you for providing this informative information. If you ever need Manual And Automation Testing services then you can get information by clicking on the given link.

    ReplyDelete
  2. Hi Sidharth, It was great pleasure in reading your article. The content on top 20 interview questions was very useful for me to clearify all my doubts and prepare for the the interview. It is the most needed content for freshers!! Also, if you're looking for the , follow us!!! Thank you for the great effort & hardwork!!!

    ReplyDelete