Created
September 10, 2016 03:00
-
-
Save executeautomation/547e69ecf04db443cdfacc10340d650a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Complete source code available in Github https://github.com/executeautomation/SeleniumParallelSample