Activity click inside one for each

Hello community,

Can you help me with a challenge? I have a loop (for each row in the data table) where for each row, I need to click on the pencil icon (as shown in the screenshot) and make some modifications. However, this “modified pencil” doesn’t disappear from the screen, and just below there’s another pencil where I need to do the same thing, and so on.

Is there a way to do this without always editing the same information because it’s within a loop? In general terms, I want to edit the first, then move to the second without altering the first, and so forth.

image

@amanda.gondim

Did you try for each ui element activity?

Cheers

Hi,

There are a few ways you could go about this.

For each row of the table, you might be able to interact with the pencil icon in first box.
If the pencil icon is not easily accessible then you could try using the row as an anchor and a click using an image selector (or perhaps just an <img tag. This of course depends on the system).

I don’t recommend it often, but sometimes you can make great use of idx in a selector. This very much depends on your use case if it is of interest.

Best regards,
Oliver

Hello everything is fine?
The problem with me iterating over the number of rows in the table is that the robot will always change the same pencil icon. I always need it to change the one on the next line. When I change the current line, there is only one thing that changes, which is a label, which changes to “quoted”.
Could I use this? but I do not know how.
Look:
image

Hi Amanda,

You could perhaps use a Find Children activity and select the entire table of rows. Here you are interested in the children being each row of your table. This way you’ll have a selector automatically generated that you can use for selecting the correct pencil icon.

Find Children
For each Child in dt_Children
Click Pencil icon (and use Child.Selector as anchor)

Also please ensure that the pencil icon selector you decide upon does not contain an idx.

Alternatively you could try fiddle with Child.Selector+unique part of Pencil selector (you can view this as using child.selector as a top level selector)

Best regards,
Oliver

You can use For each Ui Element if you are trying in Ui automation. else read the entire table save it in as a datatable and you can perform any actions accordingly.

Let me know if tis works.

I’m thinking of a solution that would be to change the table row tag using a variable as a counter, to change the elements. how can I do this? Can I put a variable inside this tag?

look

Hi @amanda.gondim

→ when you are indicating in the selector option check the strict selector and uncheck the fuzzy selector, computer vision and image.
→ In the Strict selector click on UI explorer option then one UI explorer tab will opened in that select the value for the attribute you want to pass the variable.
→ In your case it is table row, select the value and click on right then select the Select variable option, select the count variable and click on validate.
→ Click on confirm for element indication of click activity.

You have passed count variable to the table row attribute.

Hope it helps!!