I\'m trying to capture a screenshot of whole browser screen (e.g. with any toolbars, panels and so on) not only an entire page, so I\'m got this code:
using
You could get the window handle using Process.GetProcesses:
using (FirefoxDriver driver = new FirefoxDriver())
{
driver.Navigate().GoToUrl(url);
string title = String.Format("{0} - Mozilla Firefox", driver.Title);
var process = Process.GetProcesses()
.FirstOrDefault(x => x.MainWindowTitle == title);
if (process != null)
{
var screenCapture = new ScreenCapture();
var image = screenCapture.CaptureWindow(process.MainWindowHandle);
// ...
}
}
This of course assumes that you have a single browser instance with that specific title.