Instead of using the
//, you can use a single
/ but you will need to make sure that the first node in your query is HTML. Let's see an example of this:
xpath=/html/body/div/div/inputinto the Target input of Selenium IDE.
The previous locator will have found the same element as before. This type of XPath query will find the element fractionally quicker but if your UI is going to change, it may fail if the element is moved into a different area of the page. One thing to really note is that XPath locators can be extremely fragile. They can find what you want but the ...