package com.test.automation.uiAutomation.loginPage;
import java.io.IOException;
import org.apache.log4j.Logger;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.test.automation.uiAutomation.testBase.TestBase;
import com.test.automation.uiAutomation.uiActions.LoginPage;
/**
* @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 31-07-2017
*
*/
public class TC001_VerifyLoginWithInvalidCredentails extends TestBase {
public static final Logger log = Logger.getLogger(TC001_VerifyLoginWithInvalidCredentails.class.getName());
LoginPage loginPage;
@BeforeClass
public void setUp() throws IOException {
init();
}
@Test
public void verifyLoginWithInvalidCredentails() throws InterruptedException {
try {
log.info("============= Starting verifyLoginWithInvalidCredentails Test =============");
loginPage = new LoginPage(driver);
loginPage.loginToApplication("qadeepak", "11");
Thread.sleep(2000);
Assert.assertEquals(loginPage.getInvalidLoginText(), "Username or password Incorrect.");
log.info("============= Finished verifyLoginWithInvalidCredentails Test =============");
} catch (Exception e) {
log.error("Exception is: " + e.getMessage());
}
}
}
import java.io.IOException;
import org.apache.log4j.Logger;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.test.automation.uiAutomation.testBase.TestBase;
import com.test.automation.uiAutomation.uiActions.LoginPage;
/**
* @Blog Name : Selenium Code Example
* @author Deepak Gupta
* @Created Date 31-07-2017
*
*/
public class TC001_VerifyLoginWithInvalidCredentails extends TestBase {
public static final Logger log = Logger.getLogger(TC001_VerifyLoginWithInvalidCredentails.class.getName());
LoginPage loginPage;
@BeforeClass
public void setUp() throws IOException {
init();
}
@Test
public void verifyLoginWithInvalidCredentails() throws InterruptedException {
try {
log.info("============= Starting verifyLoginWithInvalidCredentails Test =============");
loginPage = new LoginPage(driver);
loginPage.loginToApplication("qadeepak", "11");
Thread.sleep(2000);
Assert.assertEquals(loginPage.getInvalidLoginText(), "Username or password Incorrect.");
log.info("============= Finished verifyLoginWithInvalidCredentails Test =============");
} catch (Exception e) {
log.error("Exception is: " + e.getMessage());
}
}
}
No comments:
Post a Comment