我尝试在一个好的步骤定义中调用测试用例。此测试用例调用自定义关键字。
问题是:
10-28-2019 04:12:05 PM Invita utente
Elapsed time: 1,962s
carrier.invita_utente.Invita_utente:70
Invita utente FAILED.
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.callTestCase() is applicable for argument types: (null) values: [null]
Possible solutions: callTestCase(com.kms.katalon.core.testcase.TestCase, java.util.Map), callTestCase(com.kms.katalon.core.testcase.TestCase, java.util.Map, com.kms.katalon.core.model.FailureHandling)自定义k。
public class randomEmail {
/**
* Check if element present in timeout
* @param to Katalon test object
* @param timeout time to wait for element to show up
* @return true if element present, otherwise false
*/
@Keyword
public String getEmail(String suffix,String prefix){
int randomNo = (int)(Math.random() * 1000);
return suffix + randomNo + "@" + prefix;
}
}脚本:步骤定义
@Then("Invita utente")
def Invita_utente() {
Mobile.setText(findTestObject('Carrier/28-invita utente/android.widget.EditText0 - Inserisci la ragione sociale dellazienda'),
'pittigghiu', 0)
Mobile.callTestCase(findTestObject('Test Cases/mobile random email'))
}发布于 2019-10-29 00:15:04
根据the docs,您需要将空映射作为参数列表进行传递(假设您没有任何参数)。此外,您可以设置失败处理,并且在指定测试用例名称时需要使用findTestCase() (而不是findTestObject())。
尝试下面的代码行:
Mobile.callTestCase(findTestCase('Test Cases/mobile random email'), [:], FailureHandling.OPTIONAL)https://stackoverflow.com/questions/58594306
复制相似问题