Raizekas

Untitled

Apr 8th, 2021
34
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package pirmi.testai;
  2.  
  3. import config.SeleniumValdymas;
  4. import nuorodos.SeleniumNuorodos;
  5. import org.junit.Before;
  6. import org.junit.jupiter.api.BeforeEach;
  7. import org.junit.jupiter.api.DisplayName;
  8. import org.junit.jupiter.api.Test;
  9. import org.openqa.selenium.By;
  10. import org.openqa.selenium.WebDriver;
  11. import org.openqa.selenium.WebElement;
  12.  
  13. public class SeleniumFormosIvedimasTest
  14. {
  15. WebDriver driver;
  16.  
  17. @BeforeEach
  18. public void init()
  19. {
  20. SeleniumValdymas seleniumValdymas = new SeleniumValdymas();
  21. driver = seleniumValdymas.initChromeDriver();
  22. }
  23.  
  24. @Test
  25. @DisplayName("Pradinio tinklalapio nurodos tikrinimas")
  26. public void testuotiTitulinioImgNuoroda()
  27. {
  28. driver.get(SeleniumNuorodos.getPirmoPuslapioHome());
  29. WebElement logo = driver.findElement(By.cssSelector("#header_logo a"));
  30. System.out.println(logo.getText());
  31. String logoNuoroda = logo.getAttribute("href");
  32. System.out.println(logoNuoroda);
  33.  
  34. }
  35.  
  36. }
  37.  
RAW Paste Data