C TakeScreenshot 擴充套件
public static Screenshot TakeScreenshot(this IWebDriver _driver)
{
return ((ITakesScreenshot)_driver).GetScreenshot();
}
用法示例:
driver.TakeScreenshot().SaveAsFile(@"/Test/Test.png",ImageFormat.Png);
public static Screenshot TakeScreenshot(this IWebDriver _driver)
{
return ((ITakesScreenshot)_driver).GetScreenshot();
}
用法示例:
driver.TakeScreenshot().SaveAsFile(@"/Test/Test.png",ImageFormat.Png);