Selenium Interview Question
Selenium Interview Question
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.
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.
3. Explain some of the strategies you have followed while using xpath?
• Firefox
WebDriver driver = new FirefoxDriver();
• Chrome
WebDriver driver = new ChromeDriver();
• Internet Explorer
WebDriver driver = new InternetExplorerDriver();
• Safari Driver
WebDriver driver = new SafariDriver();
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();
***************************************
TOP 15 BDD - CUCUMBER Interview Q&A
************************************************
AUTHOR: LinkedIn P
*. Which Source code management tool you have used and tell me some of the basic
commands that you have used?
*. 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?
Ans: SearchContext.
*. Explain some of the strategy you have followed while using xpath?
21. How to read properties file and fetch data ? Code to read common.properties
file in framework?
*************************************************
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.
ANS: