I’ve seen this reported before and there was no response from Katalon development… and the temp solution provided by other users does not work.
I am unable to send API request due to sendRequest is not being recognized…but sometimes the request does go thru. This is strange.
This is blocking us from implementing API tests properly. This keyword was working awhile ago. Am I missing something here?
if i get rid of the (findTestObject … then sendRequest is no longer underlined… i don’t know if that’s how it is now… but this does not work.
If you change your code as follows, the underline will disappear
ResponseObject response = WS.sendRequest((RequestObject)findTestObject('API Web service/POST resetFS folder' , [('de_url'): '......']))
WS.sendRequest(arg0) requires an instance of
com.kms.katalon.core.testobject.RequestObject as the argument
findTestObject(String) method returns an instance of
therefore the Test Case editor detected a type mismatch, hence warned it by underlining.
class is a subtype of
So you can cheat the Test Case editor by casting a
TestObject returned by
findTestObject(...) to a
Please note, this underline is not very significant. It is just a warning emitted by the editor. It is possibly not the reason why you test case fails. Even if the underline is erased, you test case may still fail due to some reason which is not yet looked at.
In my humble opinion, it would be better if I could write the code as follows:
import static com.kms.katalon.core.testobject.ObjectRepository.findRequestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
ResponseObject response = WS.sendRequest(findRequestObject('API Web service/POST resetFS folder', [('dev_url'): '....']))
I mean, we need the ObjectRepository to implement
method which returns an instance of
RequestObject. With it, no type-casting will be required.
findRequestObject method is not provided actually.
but this does not work.
This tells nothing to others.
Please provide more information: logs, screenshot, your test case script, test object definition, the target URL if it is public etc. See the following guidance.
[Updated August 2020]
My test is BROKEN! NOTHING WORKS! HELP ME!
Relax. We get it. We really do. There are some pretty smart and clever people on this forum, but you must realize, they are not magicians or wizards or gods. They cannot see your code, they can’t see your errors and they don’t even know what your AUT is meant to do even though it might seem perfectly obvious to you.
So please relax and follow the advice below, before you start writing your post. The advice below will tell you…
This worked. I figured it out before but forgot to update the thread. But credits to you nonetheless.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.