Skip to content

Instantly share code, notes, and snippets.

@executeautomation
Created September 10, 2016 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save executeautomation/547e69ecf04db443cdfacc10340d650a to your computer and use it in GitHub Desktop.
Save executeautomation/547e69ecf04db443cdfacc10340d650a to your computer and use it in GitHub Desktop.
using NUnit.Framework;
using OpenQA.Selenium;
namespace SeleniumParallelTest
{
[TestFixture]
[Parallelizable]
public class FirefoxTesting : Hooks
{
public FirefoxTesting() : base(BrowerType.Firefox)
{
}
[Test]
public void FirefoxGoogleTest()
{
Driver.Navigate().GoToUrl("http://www.google.com");
Driver.FindElement(By.Name("q")).SendKeys("Selenium");
System.Threading.Thread.Sleep(20000);
Driver.FindElement(By.Name("btnG")).Click();
Assert.That(Driver.PageSource.Contains("Selenium"), Is.EqualTo(true),
"The text selenium doest not exist");
}
}
[TestFixture]
[Parallelizable]
public class ChromeTesting : Hooks
{
public ChromeTesting() : base(BrowerType.Chrome)
{
}
[Test]
public void ChromeGoogleTest()
{
Driver.Navigate().GoToUrl("http://www.google.com");
Driver.FindElement(By.Name("q")).SendKeys("ExecuteAutomation");
Driver.FindElement(By.Name("btnG")).Click();
Assert.That(Driver.PageSource.Contains("ExecuteAutomation"), Is.EqualTo(true),
"The text ExecuteAutomation doest not exist");
}
}
}
@executeautomation
Copy link
Author

Complete source code available in Github https://github.com/executeautomation/SeleniumParallelSample

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment