-
Notifications
You must be signed in to change notification settings - Fork 0
/
AccountTests.cs
51 lines (44 loc) · 1.36 KB
/
AccountTests.cs
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using System.Threading;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using NUnit.Framework;
using OpenQA.Selenium.Firefox;
namespace TestingProject01
{
public class AccountTests
{
public IWebDriver driver;
string browser = "FF";
string webUrl = "http://www.sdettraining.com/projects";
[SetUp]
public void Setup()
{
driver = Browser.NewBrowser(browser, webUrl);
}
[TearDown]
public void TearDown()
{
driver.Quit();
}
[Test]
public void NewUserSignUpTest()
{
driver.FindElement(By.LinkText("Account Management System")).Click();
Thread.Sleep(3000);
driver.FindElement(By.Id("createaccount")).Click();
}
[Test]
public void LoginTest()
{
driver.FindElement(By.LinkText("Account Management System")).Click();
string username = "tim";
string password = "pass";
Thread.Sleep(3000);
driver.FindElement(By.Id("MainContent_txtUserName")).SendKeys(username);
driver.FindElement(By.Name("ctl00$MainContent$txtPassword")).SendKeys(password);
Thread.Sleep(2000);
driver.FindElement(By.Id("MainContent_btnLogin")).Click();
}
}
}