Micro Focus QTP (UFT) Forums
Finding textfield using XPATH - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Finding textfield using XPATH (/Thread-Finding-textfield-using-XPATH)



Finding textfield using XPATH - NewtoQTP - 03-15-2011

Hi

I've recently switched over from Selenium to QTP11 and am trying to get a script working using a XPATH

(/descendant::input[starts-with(@id,'uniqueid-')])[1]

The problem is the ID is uniquely generated each time so the above was an XPATH which worked in selenium to select the textfield I required. Changing the 1 to 2, then 3, etc to access other text fields.

I've been looking around and have seen QTP11 supports XPATH but I cannot find an example of how to implement this

Can anyone shed some light on this?

thanks