Click TD inside a TR doesn't work

studio

#1

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:

<table>
<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>
</table>

How can I do this?

Regards


#2

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

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

#3

Yes, it’s the structure.


#4

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


#5

Thanks for your response.

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

Regards.