Is there any easy/quick way to get the XPATH of an object from showPage/snapshot output?
Hi gkarumba,
One of the quick and easy ways to find a 'target' query to a particular control on a web page is using the 'Target Selection Helper' built into the iTest web editor. Open up the web session and just browse to the page on which the target you are looking for is located. Now on the top right corner of the browser toolbar, click on the 'Select Target' button. This will set the browser to a target selection mode. Now, just click on any object on the web page, you will see that it gets highlighted and the statusbar of the browser will show the xpath target to that element on the web page. To copy the target to the clipboard, double click on the element on the web page. Now you can paste this in your test case in any step you are adding/editing.
Also, you could also extract targets from the XML output of a 'snapshot' command. (Note: you should never use showPage for this, as showPage gives your the static HTML content of the page, while snapshot will give you thecurrent DOM as XML).One way is to use the Structure view of a snapshot step. When you click on various elements in the XML structure of the page, it will create a top-down XPATH query for you. You could also paste the XML in any freely available third party XPATH utility to help you create custom XPATHs.
No one has followed this question yet.