Hi
I am still learning Xpath structure.
I dont know difference between using @ and # in a path. Can anybody tell me that ?
Most of my records start with #,
If I write something like below is it true ? I mean if I use @ and then # in same path.
(actually it is not working, ranorex can not find anything)
.//div[@class='call_window incoming']/div[#'call_answer']//span[@innertext='Answer']
What is the difference between using @ and # in a path ?
Re: What is the difference between using @ and # in a path ?
@ is the symbol for an attribute. It is followed by the name of the attribute being searched for. For example, "@innertext" tells Ranorex to use the InnerText attribute to identify the element. It is also followed by the "='<Value>'" text to indicate the expected value. For example, a button with text of "OK" would look like this: /button[@text='OK']
The # symbol indicates that Ranorex should search for the ID attribute ONLY. The ID attribute's value MUST be UNIQUE. It is SIMILAR (but not exactly the same) to using the "@id='<Value>'" attribute. However, the '#' symbol denotes that the ID being search for is UNIQUE and that it can be HASHED in a way that makes it easier and faster for Ranorex to find. Again, this symbol ONLY applies to the ID attribute. It cannot be used with any other attribute. For example, a button with the ID of "OkButton" would look like either of these: /button[#'OkButton'] OR /button[@id='OkButton']
If you have a choice between using the @id or #, use #.
The # symbol indicates that Ranorex should search for the ID attribute ONLY. The ID attribute's value MUST be UNIQUE. It is SIMILAR (but not exactly the same) to using the "@id='<Value>'" attribute. However, the '#' symbol denotes that the ID being search for is UNIQUE and that it can be HASHED in a way that makes it easier and faster for Ranorex to find. Again, this symbol ONLY applies to the ID attribute. It cannot be used with any other attribute. For example, a button with the ID of "OkButton" would look like either of these: /button[#'OkButton'] OR /button[@id='OkButton']
If you have a choice between using the @id or #, use #.
Shortcuts usually aren't...