Click TD inside a TR doesn't work



Hi all.

I’m using Find Children activity to get elements inside a table. What I want to do is to click the specific TD inside my Table parent regarding each TR level. The structure is something like this:

<TR>level 1 ok</tr>
     <TD>Cell i want to Click</TD>
<TR>level 2 ok</tr>
      <TD>Cell i want to Click</TD>
<TR>level 3 ok</tr>
      <TD>Cell i want to Click</TD>
<TR>level 5 ok</tr>

How can I do this?



Can you confirm the structure is correct.I think TD should be inside TR

     <TD>Cell i want to Click</TD>


Yes, it’s the structure.


Few Inputs:

  1. Select scope as FIND_DESCENDANTS in find children activity
  2. Inside for each you can use Get Attribute (aaname or tag) to find the specific TR and then use if condition to filter TD’s
  3. Or you could do something like this in For Each (you need to manipulate per your requirement)

For each child in children.Where(Function(x As UiElement) x.Selector.ToString.Contains("tag='TD'") and x.Parent.Selector.ToString.Contains("aaname='level'"))

inside for each use click activity and pass your child


Thanks for your response.

I can’t understand very well the input 3, can you provide an example?