Problema con la hoja de Excel al intentar obtener los valores del script maravilloso

Si colocogetCell (0,0) en String reqTagName = sheet1.getCell (0,0) .getContents () para el siguiente código, entonces solo está ejecutando el primer valor de la hoja. Pero si colocogetCell (0, Fila) para la misma Cadena reqTagName = sheet1.getCell (0,0) .getContents () y cambia los valores en la hoja de Excel de número a cadena y luego funciona como se esperaba. Pero no funciona cuando paso el número como valor de solicitud en la hoja. He intentado cambiar el tipo de datos de String a cualquier otro, pero no funciona ...

He pegado el siguiente código:

import com.eviware.soapui.support.XmlHolder
import java.io.File
import java.io.IOException
import jxl.*
import jxl.read.biff.BiffException
import jxl.write.*
import jxl.write.Label
log.info("Testing Started")
def reqOperationName = "getInsuranceDetails_1_FTC_005"
def inputDataFileName = "D:/SOAP UI Pro/MPI.xls"
def inputDataSheetName = "MPI"
Workbook workbook = Workbook.getWorkbook(new File(inputDataFileName))
Sheet  sheet1 = workbook.getSheet(inputDataSheetName)
def responsesCount = 0

String[] Responses = null
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
String xmlResponse = reqOperationName+"#Request"
def reqholder = groovyUtils.getXmlHolder(xmlResponse)
try{
    rowcount = sheet1.getRows()
    colcount = sheet1.getColumns()
     Responses = new String[rowcount-1]
    responsesCount = rowcount-1
    for(Row in 1..rowcount-1){

    String reqTagName = sheet1.getCell(0,Row).getContents()
        log.info reqTagName
        def TagCount = reqholder["count(//*:"+reqTagName+")"]
        if(TagCount!=0){
            String reqTagValue = sheet1.getCell(0,Row).getContents()
            reqholder.setNodeValue("//*:"+reqTagName, reqTagValue)
            reqholder.updateProperty()                              
        }

    //test the request
    testRunner.runTestStepByName(reqOperationName)
    reqholder = groovyUtils.getXmlHolder(reqOperationName+"#Response")
    Responses[Row-1] = reqholder.getPrettyXml().toString()
    log.info Responses[Row-1]

    }
}
catch (Exception e) {log.info(e)}
finally{
    workbook.close()
}
Workbook existingWorkbook = Workbook.getWorkbook(new File(inputDataFileName));
WritableWorkbook workbookCopy = Workbook.createWorkbook(new File(inputDataFileName), existingWorkbook);

try
{
    WritableSheet sheetToEdit = workbookCopy.getSheet("MPI");
    WritableCell cell;
    for (int i =1;i<Responses.size();i++)
    {
    def resholder = groovyUtils.getXmlHolder(Responses[i])

    resTagValue1= resholder.getNodeValue("//*:productID")
    Label l = new Label(2, i, resTagValue1.toString());
    cell = (WritableCell) l;
    sheetToEdit.addCell(cell);

    resTagValue2= resholder.getNodeValue("//*:accountNumber")
    Label m = new Label(3, i, resTagValue2.toString());
    cell = (WritableCell) m;
    sheetToEdit.addCell(cell);

    resTagValue3= resholder.getNodeValue("//*:insuranceCategory")
    Label n = new Label(4, i, resTagValue3.toString());
    cell = (WritableCell) n;
    sheetToEdit.addCell(cell);

    resTagValue4= resholder.getNodeValue("//*:imei")
    Label o = new Label(5, i, resTagValue4.toString());
    cell = (WritableCell) o;
    sheetToEdit.addCell(cell);

    resTagValue5= resholder.getNodeValue("//*:handsetMake")
    Label p = new Label(6, i, resTagValue5.toString());
    cell = (WritableCell) p;
    sheetToEdit.addCell(cell);

    resTagValue6= resholder.getNodeValue("//*:handsetModel")
    Label q = new Label(7, i, resTagValue6.toString());
    cell = (WritableCell) q;
    sheetToEdit.addCell(cell);

    resTagValue7= resholder.getNodeValue("//*:insurancePolicyName")
    Label r = new Label(8, i, resTagValue7.toString());
    cell = (WritableCell) r;
    sheetToEdit.addCell(cell);

    resTagValue8= resholder.getNodeValue("//*:insuranceStartTimestamp")
    Label s = new Label(9, i, resTagValue8.toString());
    cell = (WritableCell) s;
    sheetToEdit.addCell(cell);

    resTagValue9= resholder.getNodeValue("//*:insuranceEndTimestamp")
    Label t = new Label(10, i, resTagValue9.toString());
    cell = (WritableCell) t;
    sheetToEdit.addCell(cell);
    }
}
catch (Exception e) {log.info(e)}
finally{
     workbookCopy.write();
 workbookCopy.close();
 existingWorkbook.close();
}
log.info("Testing Over")

Llegué a saber que el error está en la hoja de Excel. ¿Debería haber algún cambio en el código o alguna implementación con la hoja de Excel?

Cualquier ayuda sería muy apreciada.

Gracias,

Código editado después de los cambios implementados

import com.eviware.soapui.support.XmlHolder
import java.io.File
import java.io.IOException
import jxl.*
import jxl.read.biff.BiffException
import jxl.write.*
import jxl.write.Label
log.info("Testing Started")
def reqOperationName = "getInsuranceDetails_1_FTC_005"
def inputDataFileName = "D:/SOAP UI Pro/MPI.xls"
def inputDataSheetName = "MPI"
Workbook workbook = Workbook.getWorkbook(new File(inputDataFileName))
Sheet  sheet1 = workbook.getSheet(inputDataSheetName)
def responsesCount = 0


String[] Responses = null
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
String xmlResponse = reqOperationName+"#Request"
def reqholder = groovyUtils.getXmlHolder(xmlResponse)
try{
    rowcount = sheet1.getRows()
    colcount = sheet1.getColumns()
     Responses = new String[rowcount-1]
    responsesCount = rowcount-1
    for(Row in 1..rowcount-1){

    String reqTagName = sheet1.getCell(0,0).getContents()
    log.info reqTagName
    def TagCount = reqholder["count(//*:"+reqTagName+")"]
    log.info reqholder["//*:"+reqTagName]
    if(TagCount!=0){
        String reqTagValue = sheet1.getCell(0,Row).getContents()
        reqholder.setNodeValue("//*:"+reqTagName, reqTagValue)
        reqholder.updateProperty()                              
    }

    //test the request
    testRunner.runTestStepByName(reqOperationName)
    reqholder = groovyUtils.getXmlHolder(reqOperationName+"#Response")
    Responses[Row-1] = reqholder.getPrettyXml().toString()
    log.info Responses[Row-1]

    }
}
catch (Exception e) {log.info(e)}
finally{
    workbook.close()
}
Workbook existingWorkbook = Workbook.getWorkbook(new File(inputDataFileName));
WritableWorkbook workbookCopy = Workbook.createWorkbook(new File(inputDataFileName), existingWorkbook);

try
{
    WritableSheet sheetToEdit = workbookCopy.getSheet("MPI");
    WritableCell cell;
    for (int i =1;i<Responses.size();i++)
    {
    def resholder = groovyUtils.getXmlHolder(Responses[i])

    resTagValue1= resholder.getNodeValue("//*:productID")
    Label l = new Label(2, i, resTagValue1.toString());
    cell = (WritableCell) l;
    sheetToEdit.addCell(cell);

    resTagValue2= resholder.getNodeValue("//*:accountNumber")
    Label m = new Label(3, i, resTagValue2.toString());
    cell = (WritableCell) m;
    sheetToEdit.addCell(cell);

    resTagValue3= resholder.getNodeValue("//*:insuranceCategory")
    Label n = new Label(4, i, resTagValue3.toString());
    cell = (WritableCell) n;
    sheetToEdit.addCell(cell);

    resTagValue4= resholder.getNodeValue("//*:imei")
    Label o = new Label(5, i, resTagValue4.toString());
    cell = (WritableCell) o;
    sheetToEdit.addCell(cell);

    resTagValue5= resholder.getNodeValue("//*:handsetMake")
    Label p = new Label(6, i, resTagValue5.toString());
    cell = (WritableCell) p;
    sheetToEdit.addCell(cell);

    resTagValue6= resholder.getNodeValue("//*:handsetModel")
    Label q = new Label(7, i, resTagValue6.toString());
    cell = (WritableCell) q;
    sheetToEdit.addCell(cell);

    resTagValue7= resholder.getNodeValue("//*:insurancePolicyName")
    Label r = new Label(8, i, resTagValue7.toString());
    cell = (WritableCell) r;
    sheetToEdit.addCell(cell);

    resTagValue8= resholder.getNodeValue("//*:insuranceStartTimestamp")
    Label s = new Label(9, i, resTagValue8.toString());
    cell = (WritableCell) s;
    sheetToEdit.addCell(cell);

    resTagValue9= resholder.getNodeValue("//*:insuranceEndTimestamp")
    Label t = new Label(10, i, resTagValue9.toString());
    cell = (WritableCell) t;
    sheetToEdit.addCell(cell);
    }
}
catch (Exception e) {log.info(e)}
finally{
     workbookCopy.write();
 workbookCopy.close();
 existingWorkbook.close();
}
log.info("Testing Over")

En out log log puedo ver que está tomando el primer MSISDN pero después de eso está tomando algunos campos basura.

La salida del registro se menciona a continuación para cada ejecución.

Lunes 11 de diciembre 16:44:18 IST 2017: INFORMACIÓN: 447803000269

Lun 11 de diciembre 16:44:18 IST 2017: INFORMACIÓN: [Ljava.lang.String; @ 8ddf43

Lun 11 de diciembre 16:44:18 IST 2017: INFORMACIÓN: [Ljava.lang.String; @ 7 anywhered3

Lun 11 de diciembre 16:44:19 IST 2017: INFORMACIÓN: [Ljava.lang.String; @ 12dda68

Respuestas a la pregunta(2)

Su respuesta a la pregunta