C 中的簡單硒例項

//Create a new ChromeDriver
IWebDriver driver = new ChromeDriver();

//Navigate to www.google.com
driver.Navigate().GoToUrl("https://www.google.com");

//Find the WebElement of the search bar
IWebElement element = driver.FindElement(By.Name("q"));

//Type Hello World into search bar
element.SendKeys("Hello World");

//Submit the input
element.Submit();

//Close the browser
driver.Quit();