I set a Global variable(TempPwd) to get value in the first test case, and later on in this same test suite, I wanted this value pass to Varibale (password) on the second test cases, it is failed to pass this value through the setText action on Mobile testing.
The variable ‘password’ on the Log View shows the correct value.
Log:
password = 2028
StartExistingApplication -pass
tap(findTestObject(“Login Page - enter your password”), 0) -pass
setText(findTestObject(“Login Page - enter your password”), TempPwd, 0) -failed
Error message:
Reason:
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords.setText() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, java.lang.Integer, java.lang.Integer) values:
groovy.lang.MissingMethodException is your error. This means that the method parameters that you have for the setText method do not comply with any one of the ways that are correct. The error message indicates that the TempPwd is an Integer (java.lang.Integer) and the method is expecting a String.
'Set text on textbox control'
Mobile.setText(findTestObject('Application/Graphics/android.widget.TextView - Xfermodes'),'Your text here', GlobalVariable.G_Timeout)
Either insure your variable is declared a String, or convert to String with TempPwd.toString() or Integer.toString(TempPwd)