Friday, 4 August 2017

Test Script - Verify Login With Valid 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 TC002_VerifyLoginWithValidCredentails extends TestBase {

public static final Logger log = Logger.getLogger(TC002_VerifyLoginWithValidCredentails.class.getName());
LoginPage loginPage;

@BeforeClass
public void setUp() throws IOException {
init();
}

@Test
public void verifyLoginWithValidCredentails() throws InterruptedException {
try {
log.info("============= Starting verifyLoginWithValidCredentails Test =============");
loginPage = new LoginPage(driver);
loginPage.loginToApplication("qadeepak", "1");
Thread.sleep(2000);
Assert.assertEquals(loginPage.getTitleName(), "Dashboard");
log.info("============= Finished verifyLoginWithValidCredentails Test =============");

} catch (Exception e) {
log.error("Exception is: " + e.getMessage());
getScreenShot("verifyLoginWithValidCredentails");
org.testng.Assert.fail("Test failed");

}

}

}

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...