Save a screenshot of the viewport
Automation taskEasy-MediumAsked in: Capgemini, Infosys, TCS, Wipro
Interviewers ask: "How do you take a screenshot in Selenium?" and then "How do you attach it to a failed test?" Start with a screenshot of the viewport (the visible part of the page) and check that the saved file exists and is not empty.