0
我已经编写了一个groovy脚本来读取excel工作表中的数据,工作正常。 现在我在Excel中有两行。我想row1去request1和row2去request2。如何从excel中获取数据到soapui请求
下面是我的Groovy脚本
import org.apache.poi.xssf.usermodel.*
import org.apache.poi.xssf.usermodel.XSSFWorkbook
def fs = new FileInputStream(“C:\\Users\\singh532\\Desktop\\try1.xlsx”)
def wb = new XSSFWorkbook(fs)
def ws = wb.getSheet(“Sheet1”)
def r = ws.getPhysicalNumberOfRows()
for(def i=0; i<r; i++)
{
def row = ws.getRow(i)
def c = row.getPhysicalNumberOfCells()
for (def j=0;j<c;j++)
{
def cell = row.getCell(j)
def d = cell.getStringCellValue()
log.info d
}
}
我使用的soapUI 5.3 – nilay
请出示你的测试用例的结构?如多少个步骤(按照它们的类型排序)?你在尝试数据驱动的测试吗? – Rao
我有一个三个测试步骤的测试用例...第1步。上面提到的groovy脚本.... step2和step3是两个肥皂请求.....是的我正在尝试数据驱动的测试。 – nilay