How can I take a screenshot of the browser including the URL and tabs using Selenium and c#?
Please look at the pictures to see what I mean
[This is how the screenshots look today]
(https://i.sstatic.net/W2lVnbwX.png)
This is how the screenshots will look after change
The difference is – you see the line of the url and the tabs
Any ideas on how to tackle this?
my code:
public string TakeScreenshot(IWebDriver driver)
{
var screenshot = ((ITakesScreenshot)driver).GetScreenshot();
screenshot.SaveAsFile(@"C:projectsscreenshot.png");
return screenshot.AsBase64EncodedString;
}
Selenium.Support 4.18.1
Selenium.WebDriver 4.18.1
New contributor
yali is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1