Page 1 of 1

Path not fully recognized

Posted: Thu Oct 24, 2013 10:52 am
by anantha.krishnan
Hi,
I have been using the tool for nearly three months. I have encountered issues while recognizing some of the controls. we use 3rd party controls called infragistics

I see question mark in between the path

/form[@controlname='frmMain']/?/?/form[@controlname='frmProdManager']/?/?/element[@controlname='ProductID']

It does not occur for few controls. Can someone explain ways to rectify it. It is the same behaviour using spy and track.

Regards,
Anantha Krishnan.K

Re: Path not fully recognized

Posted: Fri Oct 25, 2013 1:53 pm
by krstcs
That is intended behavior. A "?" means that the element in that position is OPTIONAL.

If you have 2 "?"s then the following element can be 0, 1, or 2 levels below the last specified parent.

So for the following, the XPath would be:

-dom
--body
---table
----tbody
-----tr
------td

dom\body\table\?\?\td

This RanoreXPath would find the td even if there was no tbody\tr.