I have a problem with selenium in C#. Below is my code but I have still the same error: cannot convert from 'System.Drawing.Imaging.ImageFormat' to 'OpenQA.Selenium.ScreenshotImageFormat'
How can I fix it? Any ideas?
using System;
using System.Drawing.Imaging;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System.Drawing;
namespace Test
{
class Program
{
static void Main(string[] args)
{
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("xx://xx.xx.xx");
driver.FindElement(By.Id("xx")).SendKeys("xxx");
driver.FindElement(By.Id("xx")).SendKeys("xxx");
driver.FindElement(By.Id("xx")).Click();
Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();
ss.SaveAsFile(@"C:\\test.Png", System.Drawing.Imaging.ImageFormat.Png);
Console.Read();
Console.WriteLine("xxx");
}
}
}