findPropertyValue for XPATH

Hi!

Can you please help be on this?

I’m using Object.findPropertyValue(‘xpath’) to get the value from the ‘Attributes’ but how can I get the value from the ‘XPath’ here?

xpaath

i generally use

TestObject to=findTestObject(“path to object”)
String selector=to.getSelectorCollection().get(to.getSelectorMethod())

for the specific case where you want the XPATH selector, i believe it would be
String selector=to.getSelectorCollection().get(SelectorMethod.XPATH)

3 Likes

Thanks for the prompt response mate! Really appreciate your help :slight_smile:

Also, I checked in documentation its there if anyone might want to check further.

Link of docs below:

https://docs.katalon.com/javadoc/com/kms/katalon/core/testobject/TestObject.html#getSelectorMethod()