Now it is being printed in console precisely as if it is in the 1st example:
WebUI.click(findTestObject(‘Page_Inbox/span_CPE410486’))
However it errors with this error: Test Cases/Inbox-Tasks FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click() is applicable for argument types: (java.lang.String) values: [Page_Inbox/span_CPE410486]
Please let me know if you aware of any workaround or what is incorrect in the above case.
WebUI.click() expects TestObject as a parameter. You put String there (variable emailClick), so you get error. I assume that this variable is a path to your TestObject in ObjectRepository. So you should use findTestObject(String path) method, which returns TestObject type.
WebUI.click(findTestObject(emailClick))
It is actually the same way as you used in first example
WebUI.click() expects TestObject as a parameter. You put String there (variable emailClick), so you get error. I assume that this variable is a path to your TestObject in ObjectRepository. So you should use findTestObject(String path) method, which returns TestObject type.
WebUI.click(findTestObject(emailClick))
It is actually the same way as you used in first example
OR
WebUI.waitForElementVisible(findTestObject(emailClick, 10))
If i use the above - i will get this error:
Test Cases/Inbox-Tasks FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.testobject.ObjectRepository.findTestObject() is applicable for argument types: (java.lang.String, java.lang.Integer) values: [Page_Inbox/span_CPE410486, 10]
Possible solutions: findTestObject(java.lang.String), findTestObject(java.lang.String, java.util.Map)
Take more care with your method calls and their arguments. Your error is telling you what is wrong – it’s saying there is no existing method called findTestObject that takes a string followed by an integer, which is exactly what you are trying to do:
// THIS IS WRONG!
findTestObject(emailClick, 10)
//findTestObject(<string>, <integer>) // WRONG!
The runtime is looking at this and saying, “nope, findTestObject cannot handle this, I’m going stop the program.”
However, waitForElementPresent takes a TestObject and an integer:
WebUI.waitForElementPresent(<TO>, <integer>)
So all you’ve done is passed your 10 to the wrong method -- you passed it to findTestObject instead of waitForElementPresent. All this boils down to a misplaced closing parenthesis:
Take more care with your method calls and their arguments. Your error is telling you what is wrong – it’s saying there is no existing method called findTestObject that takes a string followed by an integer, which is exactly what you are trying to do:
// THIS IS WRONG!
findTestObject(emailClick, 10)
//findTestObject(, ) // WRONG!
The runtime is looking at this and saying, "nope, findTestObject cannot handle this, I'm going stop the program."
However, waitForElementPresent takes a TestObject and an integer:
WebUI.waitForElementPresent(, )
So all you've done is passed your 10 _to the wrong method_ \-\- you passed it to findTestObject instead of waitForElementPresent. All this boils down to a misplaced closing parenthesis:
I did lots of progress. I will zip my project to share in a day or so - just in case that you can see - i didn’t give up and your support did not go in vain