Cannot Invoke method getRowCount | SOAPUI Forum
S
srikanth jangam Posted on 02/01/2019

Hi – Please can you help?

 

I am doing the below as indicated in your video datadrivenframework SOAP UI free version.

  1. I created a groovy step – “init” with the below code.

import com.soapuitutorial.property.*

if(context.xls == null){

context.xls = new Xls_Reader("C:\\Users\\Copy of Tests.xlsx")

context.rowNum=2

}

context.polid = context.xls.getCellData("polstat", "polid", context.rowNum)

log.info "Data from XLS--> " + context.polid

 

2) Created another groovy step called “loop”

if(context.rowNum < context.xls.getRowCount("polstat ")){

 

                context.rowNum++

                testRunner.gottoStepByName("init")

}

 

When I run them together I get the below error in the loop step

 

Java.lang.NullPointerException“Cannot Invoke method getRowCount() on null object”

 

Please let me know where I went wrong.