Selenium Testing & Quality Assurance 3 — Questions and Answers
Question 1: What is the difference between verification and validation in software QA?
- They are the same process with different names
- Verification checks the product is built correctly; validation checks the right product is built (Correct answer)
- Validation is done by developers; verification by testers only
- Verification tests performance; validation tests functionality
Correct answer: Verification checks the product is built correctly; validation checks the right product is built
Verification ensures the product conforms to specifications, while validation ensures it meets the actual user needs and requirements.
Question 2: Which Selenium feature allows tests to run across multiple browsers simultaneously?
- Selenium IDE
- Selenium Grid (Correct answer)
- RemoteWebDriver alone
- TestNG annotations
Correct answer: Selenium Grid
Selenium Grid distributes test execution across multiple nodes running different browsers and operating systems in parallel.
Question 3: In QA, what does 'defect density' refer to?
- The speed at which defects are found
- The number of defects per unit of software size (e.g., per KLOC) (Correct answer)
- The severity of defects found
- The ratio of open to closed defects
Correct answer: The number of defects per unit of software size (e.g., per KLOC)
Defect density measures the number of confirmed defects relative to the size of a software module, helping gauge code quality.
Question 4: Which assertion method should be used in Selenium tests (via TestNG/JUnit) to check that two values are equal?
- assert.same()
- assertEquals(expected, actual) (Correct answer)
- verify.equal()
- checkMatch(expected, actual)
Correct answer: assertEquals(expected, actual)
assertEquals() compares expected and actual values and fails the test if they differ, making it the standard equality assertion.
Question 5: What is 'test data management' in the context of Selenium automation?
- Storing test results in a database
- Organizing and maintaining input data used by automated tests (Correct answer)
- Managing Selenium driver versions
- Tracking browser compatibility data
Correct answer: Organizing and maintaining input data used by automated tests
Test data management involves creating, maintaining, and cleaning up data that tests use as input, ensuring tests are repeatable and independent.
Question 6: Which type of testing evaluates how a system behaves under expected and peak load conditions?
- Unit testing
- Performance testing (Correct answer)
- Sanity testing
- Mutation testing
Correct answer: Performance testing
Performance testing assesses speed, responsiveness, and stability under various load conditions, including stress and load testing variants.
Question 7: When should you use explicit waits over implicit waits in Selenium?
- Never; implicit waits are always preferred
- When waiting for a specific condition on a particular element rather than a global timeout (Correct answer)
- Only when testing APIs
- When the page has no dynamic content
Correct answer: When waiting for a specific condition on a particular element rather than a global timeout
Explicit waits target specific conditions (element visible, clickable, etc.) for individual elements, providing more precision than a global implicit wait.
What is the difference between verification and validation in software QA?