NEOCODE

Selenium MCQs

1. Introduction to Selenium

Q1. What is Selenium primarily used for?

Correct Answer: C) Web Application Testing

Explanation:
Selenium is primarily designed for automating web applications for testing purposes. While it can be integrated with other tools for mobile testing (like Appium), its core functionality is focused on web browsers and web applications.

Q2. Selenium is an open-source tool. (True/False)

Correct Answer: A) True

Explanation:
Selenium is completely open-source and free to use. It's released under the Apache License 2.0, which allows users to download, modify, and distribute the software for both commercial and non-commercial use.

2. Features of Selenium

Q3. Which of the following is NOT a feature of Selenium?

Correct Answer: C) Built-in test reporting

Explanation:
Selenium itself doesn't provide built-in reporting capabilities. Test reports are typically generated using testing frameworks like TestNG, JUnit, or external reporting libraries like ExtentReports or Allure that integrate with Selenium.

Q4. Selenium supports which of the following programming languages?

Correct Answer: D) All of the above

Explanation:
Selenium WebDriver supports multiple programming languages including Java, Python, C#, Ruby, and JavaScript. This flexibility allows testers to write automation scripts in the language they're most comfortable with.

Q5. Which Selenium component is used for browser automation?

Correct Answer: C) Selenium WebDriver

Explanation:
Selenium WebDriver is the primary component used for browser automation. It provides a programming interface to create and execute test cases that interact with web browsers directly, without requiring any intermediate server.

3. Versions of Selenium

Q6. Which was the first version of Selenium?

Correct Answer: B) Selenium RC

Explanation:
Selenium Remote Control (RC) was the first version of Selenium, created in 2004. It used JavaScript to automate browsers and required a separate server to inject the automation scripts into browsers.

Q7. Selenium WebDriver was introduced after Selenium RC. (True/False)

Correct Answer: A) True

Explanation:
WebDriver was developed separately by Simon Stewart at ThoughtWorks and was later merged with Selenium RC to form Selenium 2.0. WebDriver's architecture was superior as it communicated directly with browsers without requiring JavaScript injection.

Q8. Which Selenium version merged with WebDriver to form Selenium 2.0?

Correct Answer: A) Selenium RC

Explanation:
Selenium 2.0 was formed by merging WebDriver with Selenium RC. This combined WebDriver's native browser control with RC's Selenium API, providing a more powerful and flexible automation tool.

Q9. The latest major version of Selenium (as of 2023) is:

Correct Answer: D) Selenium 4.0

Explanation:
Selenium 4.0 was released in October 2021 and is the current stable version as of 2023. It introduced several new features including improved Selenium Grid, relative locators, enhanced Chrome DevTools support, and a more W3C-compliant WebDriver protocol.

4. Record and Playback (Selenium IDE)

Q10. Which Selenium tool supports Record and Playback functionality?

Correct Answer: C) Selenium IDE

Explanation:
Selenium IDE (Integrated Development Environment) is a browser extension that allows testers to record their interactions with a web application and play them back as automated tests. It's the simplest way to create Selenium tests without writing code.

Q11. Selenium IDE records tests in which language by default?

Correct Answer: C) Selenese

Explanation:
Selenium IDE originally recorded tests in Selenese, a special HTML test scripting language. The newer version (3.0+) can export to various programming languages, but still uses its own internal format for recording.

Q12. Can Selenium IDE tests be exported to WebDriver scripts?

Correct Answer: B) Yes, to multiple languages

Explanation:
Modern versions of Selenium IDE (3.0+) allow exporting recorded tests to WebDriver scripts in multiple languages including Java, Python, C#, Ruby, and JavaScript. This feature helps bridge the gap between quick prototyping and more robust test automation.

Q13. The Record and Playback feature is primarily used for:

Correct Answer: B) Quick Test Prototyping

Explanation:
Record and Playback is most useful for quickly creating test prototypes or for testers who are new to automation. While recorded tests can be enhanced, they often need manual refinement for maintainability and robustness in production test suites.

5. Advanced MCQs

Q14. Which Selenium component is used for parallel test execution across different machines?

Correct Answer: B) Selenium Grid

Explanation:
Selenium Grid enables parallel test execution across multiple machines and browsers simultaneously. It uses a hub-node architecture where the hub distributes tests to various nodes (machines with different browser/OS configurations) for execution.

Q15. Selenium WebDriver interacts directly with the browser. (True/False)

Correct Answer: A) True

Explanation:
Unlike Selenium RC which required a server to inject JavaScript, WebDriver communicates directly with browsers through each browser's native automation support. This makes WebDriver faster and more stable than RC.

Q16. Which file format is used by Selenium IDE to save recorded tests?

Correct Answer: C) .side

Explanation:
The newer versions of Selenium IDE (3.0+) use the .side file format (Selenium IDE Project) to save test cases and test suites. This JSON-based format replaced the older HTML table format used in Selenium IDE 1.x versions.