Recall & Review
beginner
What is the purpose of generating an HTML report in Selenium testing?
An HTML report provides a clear, visual summary of test results, showing which tests passed or failed, making it easier to understand and share the outcomes.
Click to reveal answer
beginner
Name a popular Python library used to generate HTML reports for Selenium tests.
The pytest-html plugin is popular for generating HTML reports in Python Selenium tests.
Click to reveal answer
intermediate
What key information should an HTML test report include?
An HTML test report should include test names, status (pass/fail), execution time, error messages if any, and screenshots for failed tests.
Click to reveal answer
intermediate
How can you capture a screenshot on test failure in Selenium Python to include in an HTML report?
Use Selenium's
driver.save_screenshot('path.png') method inside a test failure handler to save the screenshot, then link it in the HTML report.Click to reveal answer
beginner
Why is it important to use descriptive test names and clear assertions when generating HTML reports?
Descriptive test names and clear assertions help quickly identify what each test checks and why it failed or passed, making the report easier to understand.
Click to reveal answer
Which Python tool is commonly used to generate HTML reports for Selenium tests?
✗ Incorrect
pytest-html is a widely used plugin to generate HTML reports for tests run with pytest, including Selenium tests.
What should you include in an HTML report for failed Selenium tests?
✗ Incorrect
Screenshots and error messages help diagnose why a test failed and are essential for useful HTML reports.
How do you save a screenshot in Selenium Python?
✗ Incorrect
The correct method to save a screenshot is driver.save_screenshot('filename.png').
Why is an HTML report better than a plain text report?
✗ Incorrect
HTML reports provide a visual summary with colors and structure, making results easier to understand.
What is a good practice when naming tests for HTML reports?
✗ Incorrect
Descriptive test names help readers quickly understand what each test checks in the report.
Explain how to generate an HTML report for Selenium tests using pytest-html.
Think about the command line steps and the plugin usage.
You got /3 concepts.
Describe how to include screenshots of failed tests in an HTML report.
Consider how Selenium and the reporting tool work together.
You got /3 concepts.