Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. using NUnit.Framework;
  2. using OpenQA.Selenium;
  3. using OpenQA.Selenium.Chrome;
  4. using OpenQA.Selenium.Firefox;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Diagnostics;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using OpenQA.Selenium.Support.PageObjects;
  12.  
  13. namespace ToolsQA
  14. {
  15.  
  16. class NUnitTest
  17. {
  18. [FindsBy(How = How.CssSelector, Using = "input[name='q']")][CacheLookup]
  19. public IWebElement serchBox { get; set; }
  20.  
  21. string url = "https://www.google.com";
  22. IWebDriver driver;
  23. [Test]
  24. public void TestScript()
  25. {
  26. driver = new ChromeDriver(@"C:ChromeDriver");
  27. driver.Navigate().GoToUrl(url);
  28. ////// exception at this line //////
  29. serchBox.SendKeys("beyonce");
  30. }
  31.  
  32. [TearDown]
  33. public void EndTest()
  34. {
  35. driver.Quit();
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement