0% found this document useful (0 votes)
1 views4 pages

Selenium Interview Questions Theory Coding

The document provides a comprehensive list of Selenium interview questions and answers, covering fundamental concepts such as Selenium components, WebDriver, and various functionalities like handling alerts, dropdowns, and frames. It also discusses coding examples, testing frameworks like TestNG, and integration with tools like Jenkins. Additionally, it addresses advanced topics such as parallel test execution and handling dynamic elements.

Uploaded by

Shreya Suman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views4 pages

Selenium Interview Questions Theory Coding

The document provides a comprehensive list of Selenium interview questions and answers, covering fundamental concepts such as Selenium components, WebDriver, and various functionalities like handling alerts, dropdowns, and frames. It also discusses coding examples, testing frameworks like TestNG, and integration with tools like Jenkins. Additionally, it addresses advanced topics such as parallel test execution and handling dynamic elements.

Uploaded by

Shreya Suman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Selenium Interview Questions and Answers (Theory + Coding)

1. What is Selenium?

Selenium is an open-source suite of tools used for automating web applications. It supports multiple

languages and browsers.

2. Components of Selenium?

Selenium IDE, Selenium RC (deprecated), Selenium WebDriver, Selenium Grid.

3. WebDriver vs RC?

WebDriver communicates directly with the browser; RC uses an intermediate server.

4. Languages supported?

Java, Python, C#, Ruby, JavaScript, Kotlin.

5. findElement vs findElements?

findElement returns the first matching element; findElements returns a list or empty list.

6. Launch Chrome browser?

WebDriver driver = new ChromeDriver(); driver.get("https://www.google.com");

7. get() vs navigate().to()?

Both open URLs, navigate().to() allows more navigation control.

8. What is XPath?

A syntax to navigate elements; used in locating elements in Selenium.


Selenium Interview Questions and Answers (Theory + Coding)

9. Types of waits?

Implicit Wait, Explicit Wait, Fluent Wait.

10. What is Page Object Model?

POM is a design pattern where each page has a class representing it with methods for interactions.

11. Handle dropdowns?

Use Select class with selectByVisibleText, selectByIndex, etc.

12. Handle alerts?

Use driver.switchTo().alert() with accept(), dismiss(), getText().

13. Handle multiple windows?

Use getWindowHandles() and switchTo().window().

14. Mouse hover action?

Use Actions class and moveToElement().perform().

15. Drag and drop?

Use dragAndDrop(source, target).perform() from Actions class.

16. close() vs quit()?

close() closes current window; quit() closes all windows and ends session.

17. Take screenshot?


Selenium Interview Questions and Answers (Theory + Coding)

Use TakesScreenshot and FileUtils to save the file.

18. What is TestNG?

A testing framework for grouping, prioritization, and reporting in Selenium.

19. Handle frames?

Use driver.switchTo().frame() with index, name, or WebElement.

20. Scrolling in Selenium?

Use JavascriptExecutor: executeScript("window.scrollBy(0,500)").

21. FluentWait usage?

Provides custom polling and exception handling for waiting conditions.

22. Explicit wait example?

Use WebDriverWait with ExpectedConditions.visibilityOfElementLocated.

23. Get browser logs?

Use driver.manage().logs().get(LogType.BROWSER).

24. Parallel test execution?

Use parallel attribute in testng.xml with thread-count.

25. Handle dynamic elements?

Use relative XPath functions like contains(), starts-with().


Selenium Interview Questions and Answers (Theory + Coding)

26. Broken link check?

Use HttpURLConnection to verify response codes.

27. Multi-browser testing?

Use conditionals or WebDriverManager to initialize appropriate drivers.

28. Jenkins Integration?

Pull code from Git, setup build job, and run Maven/TestNG scripts.

29. Click all checkboxes?

Loop through elements from findElements() and click if not selected.

30. Search test scenario?

Enter text, click search, validate results using assertTrue on results list.

You might also like