Advertisement
DariuszKralewski

Untitled

Apr 17th, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. class Program
  2. {
  3. //referencja do przeglądarki
  4. IWebDriver driver = new ChromeDriver();
  5.  
  6. static void Main(string[] args)
  7. {
  8. }
  9.  
  10. [SetUp]
  11. public void Initialize()
  12. {
  13. //otwarcie strony google
  14. driver.Navigate().GoToUrl("https://www.google.com");
  15. }
  16.  
  17. [Test]
  18. public void ExecuteTest()
  19. {
  20. //odszukanie elementu q
  21. IWebElement element = driver.FindElement(By.Name("q"));
  22.  
  23. //wpisanie tekstu
  24. element.SendKeys("koronowirus");
  25. }
  26.  
  27. [TearDown]
  28. public void CleanUp()
  29. {
  30. //zamknięcie przeglądarki
  31. driver.Close();
  32. }
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement