[英]Take screenshot of webpage along with the browser window
I am generating custom reports by implementing IReporter
. 我通过实现
IReporter
生成自定义报告。 I am able to take screenshot of the entire page using the following code 我可以使用以下代码拍摄整个页面的屏幕截图
((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
This captures only the HTML webpage, but I want to capture the browser window as well. 这仅捕获HTML网页,但是我也想捕获浏览器窗口。 Use case for this is say, suppose I check for the title of the page and assert fails.
比如说用例,假设我检查页面的标题并断言失败。 So, when I see the screenshot, I can see what the title of the page was at that time.
因此,当我看到屏幕截图时,可以看到当时页面的标题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.