I was getting error: WebElementNotFoundException in my tc while trying to run it for the a_Appointment. Then I used the Spy object and recorded the same object and replaced it in the tc. Even after trying all possible combination under Object 's Properties ( Attributes. Pls see attached Image ); I am still getting the error.The Object’s Properties of the old object a_Appointment and new object Spy_a_Appointment are same.ow to resolve this issue.
You got a “Selected Locator” like
//*[text() = '
Appointment
']
This XPath expression looks to me a bad joke. I am surprised, Katalon’s Spy tool is silly enough to generate such a poor locator.
I would rather manually write an XPath and try it:
//*[contains(text(), 'Appointment')]
I would recommend you to stop using the Spy and Recording tool of Katalon Studio.
You are possibly expecting these tools will generate 100% correct locators that would never emit “WebElementNotFoundException”. I am afraid, you are too opportunistic.
I would rather recommend you to study the XPath technology and/or CSS Selectors from scratch so that you get skilled enough to write correct locators manually. There are many web resources that would get you started:
Once you got skilled enough for the XPath and CSS Selectors, then the Spy and Recording tools will help you for lavorsaving of creating a lot of TestObjects.
If you are ignorant about the backing technologies, then the tools will spoil you more than help you. You expect the tools will solve everything automatically for you, but actually they fail satisfying you quite often.
I would recommend you: Read the XPath/CSS Selector tutorials first.
Are you disappointed? C’est la vie!
Hi @rohit.joshi, As Kaz pointed out relying on out of the box tools does not always solve your issues… They are meant to get you started on your journey. This might be a good starting point: How to manually create XPath locators based on HTML tags using Chrome There are many good sources on the web and the Katalon forum.