Pages

Wednesday, 20 May 2020

Top 15 Selenium Interview question for QAE/Automation Testing/SDET?





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


Before we start looking into the interview questions and answers let’s understand quickly about Selenium along with the reasons behind the popularity of the same. The most important fact about Selenium is that it has the highest market share in any of the automation solutions available in the market for web automation, and with that fact let’s start our interview preparation with Selenium questions and answers.


What is Selenium?


Selenium is an open source umbrella project for a range of tools and libraries aimed at supporting browser automation. It provides a playback tool for authoring functional tests across most modern web browsers, without the need to learn a test scripting language.


Why do we need Selenium?

Most programmers and developers who build website applications and wish to test them every now and then use Selenium. One of the biggest advantages of Selenium, which has made it so popular, is its flexibility. Any individual who creates web programs can use Selenium to test the code and applications. Further, professionals can debug and perform visual regression tests as per the requirements of the website or code.

In most organisations, it is the job of quality analyst (QA) engineers to test web applications by using Selenium. They are required to write scripts that can help in maximising accuracy and test coverage to make changes in the project and maintain the infrastructure of the test.



1. How to perform back,forward and refresh actions in selenium?
  • driver.navigate().back()
  • driver.navigate().forward()
  • driver.navigate().refresh()

2. What is the return type of findelements?

List of elements with similar property

3. Explain some of the strategies you have followed while using xpath?

Click here for answer


4. What will happen if no webelement is found for findelements?


It will return an empty list

5. What will happen if no webelement is found for findelement?

It will give error as :NoSuchElementException


 6. How to switch frames in selenium?



7. How to select value from dropdown in selenium?

Using select class as below
Select technology = new Select(driver.findElement(By.xpath("//select[@id='effectTypes']")));
technology.selectByVisibleText("Drop");


8. What are the methods provided in selenium to select from dropdown?

  •     selectByVisibleText()
  •     selectByValue()
  •     selectByIndex()
   
9. How to fetch text from UI in selenium?
  • gettext()
  • getAttribute("propertyname")

10. Explain some of the strategies to handle CAPTCHA?


11. How to get current url,title and page source?

  • driver.getCurrentUrl();
  • driver.getTitle();
  • driver.getPageSource();

12. How to clear text using selenium?

clear() — method is used to clear text from the text area
driver.findElement(By.xpath(“//input[@placeholder=’Username’]”)).clear();

13. How to do Browser Initialization for all types of browsers?

•    Firefox
WebDriver driver = new FirefoxDriver();
•    Chrome
WebDriver driver = new ChromeDriver();
•    Internet Explorer
WebDriver driver = new InternetExplorerDriver();
•    Safari Driver
WebDriver driver = new SafariDriver();

14. What is page load strategy in Selenium?

Click Here For Answer


REVISION:


28. How to get all cookies and with name of the cookie?

driver.manage().getCookies();
driver.manage().getCookieNamed("APISID");

29. How to delete all cookies and with name of the cookie?

driver.manage().deleteCookieNamed("APISID");
driver.manage().deleteAllCookies();

30. How to add a cookie?

 Cookie cookie1 = new Cookie("test2", "cookie2");
 driver.manage().addCookie(cookie1);


*************************************** TOP 15 BDD - CUCUMBER Interview Q&A

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

✍️AUTHORLinkedIn Profile

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

Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below,API TRaining Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
This includes classnotes, 300+ interview questions, 3 projects, Java Coding question set for product companies along with career guidance from FAANG employees for Automation and SDET.

For more details whatsapp: https://lnkd.in/dnBWDM33

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

SeleniumWebdriver Automation Testing Interview Questions:

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

API Testing Interview Question Set:

https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

DevOps Interview Q&A:

https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

Kubernetes Interview Question Set

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

Docker Interview Question Set

https://automationreinvented.blogspot.com/Docker

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/2021/09/top-40-git-interview-questions-and.html

Coding Interview Question Set:

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

Mobile Testing Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:

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


 


2 comments:

  1. You can use getAttribute(); method
    Thanks

    ReplyDelete
    Replies
    1. driver.findElement(By.xpath(“//input[@placeholder=’Username’]”)).getAttribute("value");

      Delete