Tuesday, June 3, 2014

AtLoginValid

package com.LinkedIn.testScripts;

import java.io.IOException;

import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import org.testng.annotations.Test;

import com.LinkedIn.objectPage.BasePage;
import com.LinkedIn.objectPage.LoginPage;
import com.LinkedIn.utilLibrary.GenericUtilLibrary;

public class AtLoginValid extends SuperTestNG{
    @Test()
    public void loginValidTest() throws InvalidFormatException, IOException{
        LoginPage lP = new LoginPage(driver); //create an instance of LoginPage
        BasePage bP = new BasePage(driver); //create an instance of BasePage
       
        String user = GenericUtilLibrary.getCellValue("./BrowserAndURL.xlsx", "Sheet1", 1, 1);
        String pass = GenericUtilLibrary.getCellValue("./BrowserAndURL.xlsx", "Sheet1", 1, 2);
        String exp  = GenericUtilLibrary.getCellValue("./BrowserAndURL.xlsx", "Sheet1", 1, 3);
       
        lP.login(user, pass);
        String act = driver.getTitle();
        bP.assertByTitle(exp, act);
    }
}

1 comment:

  1. thanks for the nice post,it is really informative for guys like us who can visualize the real time environment for automation test execution flows,i was looking for validation steps in test scripts which i got here...
    Next scenario,if test case fails,then just log the defect in defect tool , right???? Does pass and fail testcases can be linked to defect tracking tool or generally it is done manually??? Could you please give some light on how test cases execution results(executed,not executed,pass and fail) are managed??
    Prannoy

    ReplyDelete