Selenium Tutorial-Batch 6-Session-1

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Code:
public class TestClass {


@Test
public void t_01_login_in_to_parabank() {
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);

Reporter.log("URL Opened <br>", true);
Reporter.log("User name entered as John <br>", true);
WebElement password =
password.sendKeys("demo");
Reporter.log("Password entered as demo <br>", true);

Reporter.log("Clicked on Log In <br>", true);
//Assertion 1
String expected_title = "ParaBank | Accounts Overview";
String actual_titile = driver.getTitle();
Assert.assertEquals(actual_titile, expected_title);

//Assertion 2
WebElement welcome_text = driver.findElement(By.xpath("//p[contains(text(), 'John' ) and @class='smallText']"));
boolean actual_displayed = welcome_text.isDisplayed();
Assert.assertEquals(actual_displayed, true);
Reporter.log("Assertion Passed <br>", true);

//close
driver.quit();
Reporter.log("Assertion Passed <br>", true);

}

automationfraternity