Find Next html element

uiautomation

#1

Hello

I have a doubt about selectors. I need to find and element inside a div like this:

<-div>
<-dl>
<-dt>value1:<-/dt><-dd>111<-/dd>
<-dt>value2:<-/dt><-dd>222<-/dd>
<-dt>value3:<-/dt><-dd>333<-/dd>
<-/dl>
<-/div>

The relative position of every dt-dd pair is no the same, it depends on data, so next time it can be this:

<-div>
<-dl>
<-dt>value3:<-/dt><-dd>333<-/dd>
<-dt>value2:<-/dt><-dd>222<-/dd>
<-dt>value1:<-/dt><-dd>111<-/dd>
<-/dl>
<-/div>

(the - symbol is for escaping the html tags)

If I want to find the value of the dd sibling of one DT, ¿could I use selectors or some activity, or I could only try finding by image for example? I tried anchoring the DT successfully, but the anchor needs a descendant as far as I know, not working with siblings…

Thank you


#2

I tried something attached is the solution, may not be totally right, but im assuming it will point you in a right direction.

siblings.xaml (11.8 KB)


Check if something exists next to an element
#3

Thank you very much for your help, I’ll review your example, sure it helps :slight_smile:

Cheers!


#4

Hi
Actually in your case nav tag would do the needed. For example if i want to get the corresponding result of ‘value3’ frame the selector as folllows