In my implementation the folder is specified in the App.config
file, like so:
<add key="ScreenShot.FolderPath" value="..\\..\\..\\TestProject\\Screenshots\\" />
This is helpful when you have your CI server running the auto tests. So the XML poke will look like this:
<XmlPoke XmlInputPath="TestProject\App.config"
Query="//appSettings/add[@key='ScreenShot.FolderPath']/@value"
Value="$(ScreenShot.FolderPath)"/>
And finally in your code you point where the actual screenshots to be saved:
var screenshotDriver = IWebDriver as ITakesScreenshot;
if (screenshotDriver != null)
{
var screenshot = screenshotDriver.GetScreenshot();
screenshot.SaveAsFile(ConfigurationManager.AppSettings["ScreenShot.FolderPath"]
+ screenShotName, ImageFormat.Jpeg);
}