forked from nadvolod/ParallelTestingTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParallelLocal.cs
More file actions
37 lines (35 loc) · 1.2 KB
/
ParallelLocal.cs
File metadata and controls
37 lines (35 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using NUnit.Framework;
using OpenQA.Selenium.Firefox;
namespace ParallelLocal
{
[TestFixture]
[Parallelizable]
public class ParallelLocal
{
[Test]
public void Test1()
{
var driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.qtptutorial.net/automation-practice");
driver.Manage().Window.Maximize();
driver.FindElementById("idExample").Click();
var elementCheck = driver.FindElementByXPath("//p[contains(text(),'Button success')]").Displayed;
Assert.IsTrue(elementCheck, "Element was not present");
}
}
[TestFixture]
[Parallelizable]
public class ParallelLocal2
{
[Test]
public void Test2()
{
var driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://www.qtptutorial.net/automation-practice");
driver.Manage().Window.Maximize();
driver.FindElementByClassName("buttonClassExample").Click();
var elementCheck = driver.FindElementByXPath("//p[contains(text(),'Button success')]").Displayed;
Assert.IsFalse(elementCheck, "Element was not present");
}
}
}