Using optional element
Posted: Thu Oct 16, 2014 9:15 am
Hi Guys,
I've worked on a project in the past and the UI has the following structure:
I set the domain via a variable at the top level. The example below is a textbox items XPath in the crrent repository.
/dom[@domain=$varDomain]//input[#'username']
So i'm working on a new project now and I want to use the same repository items. However, the difference in the UI is an IFrame. See below:
/dom[@caption='Page']//iframe[@id='iFrame']//input[#'username']
I am trying the following in Ranorex Spy to track the item on the new UI but it is not detecting. Please point me in the right direction. The below Xpath works on the old UI but not the new one:
/dom[@domain=$varDomain or @caption='Page']/?//input[#'username']
If I replace the question mark with the iframe[@id=@iFrame'] it detects the element. I thought the whole point of the ? was so it will be regaded as an optional element. Please help me asap. Thanks
I've worked on a project in the past and the UI has the following structure:
I set the domain via a variable at the top level. The example below is a textbox items XPath in the crrent repository.
/dom[@domain=$varDomain]//input[#'username']
So i'm working on a new project now and I want to use the same repository items. However, the difference in the UI is an IFrame. See below:
/dom[@caption='Page']//iframe[@id='iFrame']//input[#'username']
I am trying the following in Ranorex Spy to track the item on the new UI but it is not detecting. Please point me in the right direction. The below Xpath works on the old UI but not the new one:
/dom[@domain=$varDomain or @caption='Page']/?//input[#'username']
If I replace the question mark with the iframe[@id=@iFrame'] it detects the element. I thought the whole point of the ? was so it will be regaded as an optional element. Please help me asap. Thanks