I can see the values in sysOut but still it returns nullPointer Exception. What am I doing wrong?
class ProjUtils {
int noSteps;
String testName="";
String DMS;
String appL;
String func;
String subFunc;
String desc="";
String regPriority = "High||Medium||Low";
String type = "Manual||Automated";
String[] stepName ;
String[] stepDesc ;
String[] expRes ;
int counter=1;
int caseCounter = 1;
public void preDefSteps() {
System.out.println("Enter number of predefined steps:");
String stName = null,stDesc = null,expResu = null;
try {
noSteps = Integer.valueOf(br.readLine());
int i =0;
while(i<noSteps && br.readLine() !=null){
br.readLine();
System.out.println("Step Name:\n");
stName = br.readLine();
System.out.println("Step Descripiton:\n");
stDesc = br.readLine();
System.out.println("Expected Result:\n");
expResu = br.readLine();
br.readLine();
System.out.println(stName + "\n" + stDesc + "\n" + expResu);
stepName[i] = stName;
stepDesc[i] = stDesc;
expRes[i] = expResu;
i++;
}
O/P: java.lang.NullPointerException at testCaseAuto.ProjUtils.preDefSteps(ProjUtils.java:199) at testCaseAuto.ProjUtils.newConfig(ProjUtils.java:82) at testCaseAuto.Home.main(Home.java:29)