Selenium Testing Framework Selenium CI/CD Integration & Automation Architecture 2 — Questions and Answers
Question 1: What is the role of WebDriverManager library in a Selenium project?
- It manages browser window sizing
- It automatically downloads and configures browser driver binaries (chromedriver, geckodriver) (Correct answer)
- It manages WebDriver session timeouts
- It handles Selenium Grid registration
Correct answer: It automatically downloads and configures browser driver binaries (chromedriver, geckodriver)
WebDriverManager eliminates the need to manually download and path-configure browser drivers by handling this automatically at runtime.
Question 2: In a Selenium framework, what is the purpose of a configuration/properties file?
- To store test screenshots
- To externalize environment-specific settings like URLs, credentials, and timeouts (Correct answer)
- To define XPath locators
- To configure the JVM heap size
Correct answer: To externalize environment-specific settings like URLs, credentials, and timeouts
Externalizing configuration to a properties file allows the same test suite to run against dev, staging, or prod without code changes.
Question 3: Which design pattern is used to create the correct WebDriver instance (ChromeDriver, FirefoxDriver) based on a configuration parameter?
- Singleton
- Factory (Correct answer)
- Observer
- Decorator
Correct answer: Factory
A WebDriver Factory creates the appropriate driver instance based on the browser configuration, keeping test setup code clean and extensible.
Question 4: What is the advantage of using TestNG's parallel execution with `threadPoolSize` in CI?
- It reduces the number of test methods needed
- It runs multiple tests concurrently, reducing total pipeline duration (Correct answer)
- It automatically retries failed tests
- It generates parallel HTML reports
Correct answer: It runs multiple tests concurrently, reducing total pipeline duration
Running tests in parallel with a thread pool significantly reduces wall-clock time for large suites, speeding up CI feedback loops.
Question 5: What is a 'smoke test suite' in the context of CI/CD with Selenium?
- A full regression suite run nightly
- A small, fast subset of critical tests run on every commit to catch major breakages quickly (Correct answer)
- Tests that check for memory leaks
- Performance load tests
Correct answer: A small, fast subset of critical tests run on every commit to catch major breakages quickly
A smoke test suite contains the most critical happy-path tests to verify that a build is fundamentally working before running the full suite.
Question 6: Which artifact should Selenium CI jobs archive so that failures can be debugged after the job completes?
- Compiled .class files
- Screenshots and browser logs captured on test failure (Correct answer)
- Node_modules directory
- Maven .m2 cache
Correct answer: Screenshots and browser logs captured on test failure
Archiving failure screenshots and browser console logs gives developers the visual context needed to diagnose why a test failed in CI.
What is the role of WebDriverManager library in a Selenium project?