Hello everyone. I have an element’s xpath on mobile testing under record mobile tab under object properties. How can I use it?
You can use the xpath to find an object in a few ways:
You can use the Mobile Recorder/Spy Mobile to save/export a new Test Object in the Object Repository:
You can then double-click that Test Object to edit the properties. Edit the Attributes to uncheck everything except the xpath:
Alternatively, you can create a new Test Object in the Object Repository, giving it the “xpath” Name, “equals” Condition, and pasting in the Value of the xpath you want:
Finally, if you’d like to find an object by xpath in code, you can do the following:
import com.kms.katalon.core.testobject.ConditionType import com.kms.katalon.core.testobject.TestObject TestObject myNewObject = new TestObject("TheObjectName") myNewObject.addProperty("xpath", ConditionType.EQUALS, "//html/body")
@Chris Trevarthen Thank you so much !!!