Getting NullPointer Exception | Selenium Forum
M
Manjula Edpuganti Posted on 01/09/2019

When i try to execute the below code, i am getting nullpointer exception. I followed the same below code as was mentioned in the video. But not able to figure out why i am getting the errorr.

*****************************************************************************************************************************

 

 

 

package com.qtp.selenium.hybrid.base;

import com.qtp.selenium.hybrid.util.Xls_Reader;

public class Temp {

public static void main(String[] args) {
String testName="TestB";

Xls_Reader xls = new Xls_Reader("C:\\Users\\manju\\Documents\\SuiteA.xlsx");
//find the row number of testcase
int testStartRowNum=1;
while(!xls.getCellData("Data", 0, testStartRowNum).equals(testName)){
testStartRowNum++;
}
System.out.println("Test starts from row - "+ testStartRowNum);
//find total cols in testcase
//find total rows in testcase

}

}

*********************************************************************************

java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException
at com.qtp.selenium.hybrid.util.Xls_Reader.getCellData(Xls_Reader.java:130)
at com.qtp.selenium.hybrid.base.Temp.main(Temp.java:13)
java.lang.NullPointerException


A
Ashish Thakur Replied on 02/09/2019

Please zip your project and send it to us