I run this code and continually snag on the line: "IWebDriver Driver = new OpenQA.Selenium.Chrome.ChromeDriver();" When i run it this way, not directing to the ChromeWebDriver, I get: "the chromedriver.exe file does not exist in the current directory or in a directory on the PATH environment variable."
When I give the path to the ChromeWebDriver I get this: "error CS1009: Unrecognized escape sequence"
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
IWebDriver Driver = new OpenQA.Selenium.Chrome.ChromeDriver
("C:\Users\stand\Documents\
Visual Studio 2015\Projects\WindowsFormsApplication2\ChromeWebDriver.exe");
Driver.Navigate().GoToUrl("http://dallas.craigslist.org/");
IWebElement Element = Driver.FindElement(By.Name("query"));
Element.SendKeys("cx-5");
}
}
}