Personalized selector not working with ‘For each UI element’ activity

I try to use a ‘For each UI element’ activity, I customized the selector in Properties>Target>Strict Selector.


The target is valid and can see it highlighted, but when I try to run the activity I get the message ‘Extraction failed. Table not found.’


What is causing this issue?

Hi @Alex_G

Your selector doesn’t seem like ok to me. Please open that selector in ui explorer and selector more properties to fine tune the selector.

Do you have multiple browser windows open to the same page?

Hi

I tried before many other selector combinations and still didn’t work, I don’t think the selector is the issue.

No, I closed all the other browsers and windows.

@Alex_G

First check whether it is table format or not by doing inspect on that page you can see whether it is table format or not.

and try to use table extraction activity to extract the data from that targeted table. If it works then you can use this or

Try to add some check app state whether targeted table was available on the screen.

try these options

Happy automation!!

@Alex_G

in for each ui element its not one single element that you indicate its a group of elements and then each eleement is idetified by the for each

if you indicate and open the selector you would see the selector would be one or two levels higher

cheers

The data that I’m trying to extract is not in table format, is just similar enough, so I thought that I can use for each.

I tried to use table extraction, but got the same issue, I just can’t fine tune the selector for each column (using the selector found by clicking the element is always wrong and get bad data per column).

Tried check app state, the target is available.

I’m trying to select the <div class='order-items'> elements, which contains exactly the info I need. The structure on the website is like this:

@Alex_G

When you indicate on for each ui eleemnt may I know what selector is it showing from selector panel after you save

Cheers

The only selector that it picks using the indicator is this:

And hierarchy is like this:
“<span class=‘account_holder’>->
<div class=‘order-hist-box clearfix’/>->
<div class=order-items/>”

I see DIV tags which are not table formats. Extraction can be a little hard.

Suggestion:

  • Build a datatable
  • Define each parameter you need and extract those records by adding them to the table row.
  • Use “Get Text”, use wild cards (*) to define the element since they can change.
  • Make sure the selector has some unique values. Sometimes you can couple it up with variable names. (Eg: class=“account_holder+{{‘ITEM_NAME’}}”)

Cheers..

I think there may be a fundamental misunderstanding of this activity happening here. The selector is not for which elements it will loop through. The selector is for the parent container of those elements. When you add a new For Each UI Element and designate items, you’re supposed to designate the items (ie columns, repeated objects, etc) that you want it to loop through. It figures out the parent container for you.

What happens when you just let the wizard do its thing and don’t touch the selector?

If I let the wizard do its thing, unwanted elements are getting selected (those unwanted elements have different data and selectors inside, only the parent div is the same) and I don’t know how to filter them out.

Filter them out using an If inside the For Each. You can get whatever properties you need using Get Attribute to figure out if it’s a UI element you want to process.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.