Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Test
- public void loginToTheSiteAndVerification(){
- driver.get("http://nnmclub.to");
- WebElement buttonAuthorization = driver.findElement(By
- .xpath("//*[contains(@class,'mainmenu')and contains(text(),'Вход')]"));
- buttonAuthorization.click();
- WebElement login = driver.findElement(By.name("username"));
- login.sendKeys("Ксения00788");
- WebElement password = driver.findElement(By.name("password"));
- password.sendKeys("zadanie");
- WebElement buttonLogin =driver.findElement(By.className("mainoption"));
- buttonLogin.click();
- boolean isPresentButtonLogout = driver.findElements(By
- .xpath("//*[contains(@class,'mainmenu')and contains(text(),'Выход')]")).size()>0;
- if (isPresentButtonLogout){
- System.out.println("Вход на сайт был успешным");
- }else {
- System.out.println("Вход на сайт не был успешным");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement