Interviewer And Interviewee Guide

Automation Interview Question:

Explain me how can we capture screenshots in Selenium?

Submitted by: Muhammad
We can take the screenshots in selenium by using getScreenshotAs method of TakesScreenshot interface:

File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("C:screenshot1.jpg"));
Submitted by: Muhammad

Read Online Automation Job Interview Questions And Answers
Copyright 2007-2025 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.

Interview Questions Answers .ORG