Guest User

test

a guest
Jul 18th, 2016
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. using System;
  2. using Microsoft.VisualStudio.TestTools.UnitTesting;
  3. using OpenQA.Selenium.Remote;
  4. using OpenQA.Selenium.Firefox;
  5. using OpenQA.Selenium;
  6. using OpenQA.Selenium.Support.UI;
  7. using NUnit.Framework;
  8.  
  9. namespace NUNIT
  10. {
  11. [TestClass]
  12. public class unit1
  13. {
  14. IWebDriver driver = new FirefoxDriver();
  15.  
  16.  
  17. [SetUp]
  18. public void Initialing()
  19. {
  20. driver.Navigate().GoToUrl("http://executeautomation.com/demosite/index.html?UserName=&Password=&Login=Login");
  21. driver.Manage().Window.Maximize();
  22. Console.WriteLine("Website opened");
  23. }
  24.  
  25.  
  26. [Test]
  27. public void ExecuteTest()
  28. {
  29. //Title
  30. SeleniumSetMethods.SelectDropDown(driver, "TitleId", "Mr.", "Id");
  31.  
  32. //Initial
  33. SeleniumSetMethods.EnterText(driver, "Initial", "executeautomation", "Name");
  34.  
  35. //First Name
  36. SeleniumSetMethods.EnterText(driver, "FirstName", "Bogdan", "Id");
  37.  
  38. //Click
  39. SeleniumSetMethods.Click(driver, "Save", "Name");
  40.  
  41. Console.WriteLine("Test Executed");
  42. }
  43.  
  44.  
  45. [TearDown]
  46. public void CleanUp()
  47. {
  48. driver.Close();
  49. Console.WriteLine("Browser Closed");
  50. }
  51.  
  52. }
  53. }
Add Comment
Please, Sign In to add comment