Recall & Review
beginner
What is a flaky test in software testing?
A flaky test is a test that sometimes passes and sometimes fails without any changes in the code. It behaves unpredictably, often due to timing or environment issues.
Click to reveal answer
beginner
Why do we use a retry mechanism for flaky tests?
We use retry mechanisms to automatically rerun tests that fail due to temporary issues. This helps reduce false failures and makes test results more reliable.
Click to reveal answer
intermediate
How can you implement a retry mechanism in Selenium with Python?
You can implement retry by using a decorator or a loop that reruns the test function a set number of times until it passes or the retries run out.
Click to reveal answer
intermediate
What is a simple example of a retry decorator in Python for flaky tests?
A retry decorator runs a test function multiple times if it raises an exception, stopping early if the test passes. It helps handle flaky failures automatically.
Click to reveal answer
beginner
Name one common cause of flaky tests in Selenium automation.
Common causes include timing issues like waiting for elements to load, network delays, or asynchronous page behavior.
Click to reveal answer
What does a retry mechanism do in test automation?
✗ Incorrect
Retry mechanisms rerun tests that fail temporarily to avoid false negatives.
Which of these is a common cause of flaky tests?
✗ Incorrect
Timing issues such as slow page loads often cause flaky tests.
In Python, what feature can help implement retries elegantly?
✗ Incorrect
Decorators can wrap test functions to add retry logic cleanly.
What should a retry mechanism do when a test passes on a retry?
✗ Incorrect
Once a test passes on retry, the mechanism should stop and mark it passed.
Which Selenium Python tool can help wait for elements to avoid flaky tests?
✗ Incorrect
Explicit waits wait for conditions and reduce flaky failures.
Explain what a flaky test is and why retry mechanisms help in Selenium testing.
Think about tests that fail sometimes without code changes and how retrying helps.
You got /5 concepts.
Describe how you would implement a simple retry mechanism in Python for Selenium tests.
Consider wrapping the test function to catch failures and retry.
You got /5 concepts.