I am new to UFT. I have a long "complex" xpath that finds precisely one element in chrome browser developer tools. When I use the same xpath in uft, the tool complains that the xpath is not in the object repository. Why does this happen and how do I fix it ?
This is what the xpath looks like:
//div[@class='a b c']//div[@class='p-q r-s']//div[@class='m n']//button[contains(text(), 'yes')]
I have to use such complex xpath because there are no ID attributes in this part of the page or any other 1-2 attributes which can uniquely identify the element.
Please help.
EDIT: My Vbscript code looks similar to this code:
Dim aButtonLoc
aButtonLoc = "//div[@class='a-b c-d-e g']" & _
"//div[@class='p-q r-s-t']//div[@class='uv w-x']" & _
"//button[contains(text(), 'Yes')]"
Error message: The {full xpath here} object was not found in the Object Repository. Check the Object Repository to confirm that the object exists or to find the correct name for the object.
UFTcode is dealing with an object it expects you to have in the OR. Please show the actualUFTcode that you're using and we can help you make use of your xpath properly to identify it. - Dave