Is there a way to findTestObject by id?

I can see that the file import button on my website has an id of ‘txtFileURL’ but I do not know how to find the test object with the XPath rather than id because if I record the test and click on the button nothing records for that step, so I do not know what the XPath is. Is there any other way to find the test object?


chooseFile = findTestObject('website/input_txtFileURL')

WebUI.uploadFile(chooseFile, 'Files/AddressImportTemplate.csv')

Test object 'txtFileURL' does not exist

If this is indeed the case, that sounds like a bug in the Recorder.

You will probably need to create your own test object with a custom xpath. If you can share a screenshot of the HTML for the button, I’m pretty sure I can give you a suggestion.

1 Like

I thought maybe it did not record clicking the upload button because (even though I am using the word button) it is just an input file and not an actual button. I know that when I was looking for the remove button and I recorded Katalon set the XPath of it to 'website/input_City_cmdRemoveLogo' and I presume the reason for this is because the remove button is in the same horizontal line as the remove button. So I think maybe Katalon cannot find the upload file because it goes on its own map of the objects and I am unsure of how it does this.

Hello @krista.strzeszkowski

Do you can try this xpath (it can apply for all your id objects, if this element is a input, if no, you can substitute it)

1 Like

Ok perfect. Please take a look at the following topic:

If you follow the approach outlined there, I’m pretty sure you will be able to fix this.

1 Like

Thank you both, I will try this!

1 Like

Yes. Change your TestObject to use CSS instead of XPath and enter this: