Friday, 4 August 2017

Test Script - Verify Login With Invalid Credentails

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());
}
}

}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...