我有一个自动化测试,它创建了一个加载到 Excel 文件中的 n 个人。 (创建新人)
现在我正在尝试创建一个“新案例测试”,调用“创建新人员”来获取人员并将其添加到案例中。然而,在运行时,新案例测试成功调用“创建新人员”,但并未从 Excel 文件中提取归因。
如果我单独运行“创建新人”,它工作得很好。它从 Excel 文件中提取数据并加载人员
这是“新案例测试”
//Login
WebUI.callTestCase(findTestCase('Login'), [:], FailureHandling.STOP_ON_FAILURE)
System.out.println("we are logged in");
WebUI.click(findTestObject('Object Repository/Page_Landing/a_Area'))
//Create People
WebUI.callTestCase(findTestCase('Create new Person'), [:], FailureHandling.STOP_ON_FAILURE)
WebUI.click(findTestObject('Object Repository/Page_Person Profile (PP000)/a_Case Profile'))
System.out.println("people are created");
在这一步调用测试用例创建新人将值传递给该变量。类似的东西。
String somedatafromexcel = XLSsheet 数据。或者使用 Apache poi 从 excel 读取数据并传递。
//创建人员 WebUI.callTestCase(findTestCase('创建新人'), [somevariable:somedatafromexcel], FailureHandling.STOP_ON_FAILURE)