Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Test]
- public void SearchForTest()
- {
- IWebElement searchbox = _driver.FindElement(By.Name("q"));
- searchbox.SendKeys("Test");
- searchbox.SendKeys(Keys.Enter); //send [enter] key to the control.
- Assert.AreEqual("Test - Google Search", _driver.Title);
- }
- [Test]
- public void SearchForTestAndFindResult()
- {
- IWebElement searchbox = _driver.FindElement(By.Name("q"));
- searchbox.SendKeys("test");
- searchbox.SendKeys(Keys.Enter); //send [enter] key to the control.
- Assert.IsNotNull(_driver.FindElement(By.LinkText("Test Central")));
- }
- [Test]
- public void SearchForSelenium()
- {
- IWebElement searchbox = _driver.FindElement(By.Name("q"));
- searchbox.SendKeys("Selenium");
- searchbox.Submit(); //submits the form that the control is on.
- Assert.AreEqual("Selenium - Google Search", _driver.Title);
- }
Add Comment
Please, Sign In to add comment