Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndyDaSilva52/6088679 to your computer and use it in GitHub Desktop.
Save AndyDaSilva52/6088679 to your computer and use it in GitHub Desktop.
namespace SeleniumTest
{
[TestFixture(typeof(FirefoxDriver))]
[TestFixture(typeof(InternetExplorerDriver))]
public class BlogTest<TWebDriver> where TWebDriver : IWebDriver, new()
{
private IWebDriver _driver;
[Test]
public void SearchResults_ShouldHaveCorrectPageTitle()
{
_driver = new TWebDriver();
// Navigate
_driver.Navigate().GoToUrl("http://www.deanhume.com");
IWebElement searchBox = _driver.FindElement(By.Name("searchValue"));
searchBox.SendKeys("moq");
searchBox.Submit();
Assert.AreEqual("Dean Hume - Search Results - moq", _driver.Title);
}
[TestFixtureTearDown]
public void FixtureTearDown()
{
if (_driver != null) _driver.Close();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment