Hi @Ibus , tried your solution, and the result is:
with the class attribute clicked in the object, but get the text of another label, this is because all the classes in the text label are the same.
I tried un-clicking the object’s attribute class and the variable prints nothing (absolute in blank)
Hey @kazurayam tried your solution in three different scenarios:
the code:
-
clicking text attribute in object and result is not found
-
clicking text and class attribute, the result not found
-
disabling all the attributes in the object, its a PASS but variable printing nothing
You gave the key text
in the Map as 2nd argument of findTestObject() call.
Mobile.verifyElementExist(findTestObject('Roles/Role_Audit/Audit_Date',
['text' : "${AuditDate}"]), 0)
This is a mistake.
Your Test Object has an interpolation expression ${AuditDate}
. Then you need to specify the name of the expression (AuditDate
) as the key of Map as the 2nd argument for findTestObject() call:
Mobile.verifyElementExist(findTestObject('Roles/Role_Audit/Audit_Date',
['AuditDate' : "${AuditDate}"]), 0)
+10000000 thanks @kazurayam
It worked!!
what i did was:
Mobile.verifyElementExist(findTestObject(‘Roles/Role_Audit/Audit_Date’, [‘AuditDate’ : “${AuditDate}”]), 0)
tempvar = Mobile.getText(findTestObject(‘Roles/Role_Audit/Audit_Date’, [‘AuditDate’ : “${AuditDate}”]), 0)
println(tempvar)
and the object:
the result: