Testing / Ranorex Interview questions
How do you capture and validate screenshots in Ranorex reports?
Screenshots can be attached to a Ranorex report either automatically or explicitly, depending on how much detail a given step needs.
Test Suite settings include an option to capture a screenshot automatically whenever an error or validation failure occurs, which is normally left on so every failure in the report comes with visual context by default. For steps that deserve documentation even when they pass - a key screen a stakeholder wants to see in the report - a screenshot can be captured explicitly in code.
Report.Screenshot(repo.OrdersPage.Self, "Orders page after filter applied"); Validate.Attribute(repo.OrdersPage.ResultCountInfo, "Text", "12 results");
Validation itself is separate from the screenshot: Validate.Attribute (or similar Validate calls) checks the actual UI state against the expected value and logs a pass/fail entry, while the screenshot is just supporting evidence attached to that log entry - together they give a reviewer both the objective pass/fail result and the visual proof of what the screen actually looked like at that point.
More Related questions...