Trying to match two filter with find children activity on the same row

Hello everyone,

I’m stuck with a problem on a table in a web page, I have to count the number we have green arrow and the number we have orange arrow, this looks like that :

So I use find children activity for finding the arrow I want because they are a different alt tag if they are green or orange, my xaml look like this :

Test.xaml (5.8 KB)

I can count the number of row in the table but I can’t filter by the name of the arrow and I don’t understand why.

This is what you can find on the webpage :

And this is my UIexplorer :

I know I miss something, but I don’t know what, maybe you can tell me.

Regards,

HI
In the third screenshot, you need to check the elements which are not selected(on the right side) It shows as “Elements deselectionnes”. There should be a selector for img src. And if you observe image name should be different for up and down arrows. For example, in the second screenshot the image name could be low.svg and for upper arrow Iam guessing it is high.svg. if so, you could use this selector to count the number of occurrences based on the img src selector.

Hi @sawaseem,

Thank your for your reply !
I already try to use the src selector, the alt selector, the aaname selector, everything or almost all selector for the arrows.

But this never work and I don’t know why…

In my xaml file I have the find children activity who’s configured with a filter : “” and a selector for the table : "< html app=‘chrome.exe’ title=‘Météo TMA - e-dem - CNRS’ />
< webctrl tag=‘TABLE’ />
< webctrl tag=‘TBODY’ />
"

After that I have an Highlight activity (for helping to see) in a for each for running all the table in the Highlight I have the selector : " item.Selector.ToString +"< webctrl tag=‘TD’ />" "

If I run that I have the variable in the output of the Find Children activity who’s equal to the number of row in the table (so all the rows, all the arrows) but I want to filter it by the different arrow, so I try many thing to filter only for one type of arrow but this never work, most of the time I have errors on the selector and I don’t know how to fix it.

What will you do in the Find Children activity in the selector for making that right ? I can give you more screenshot if you want !

Your output variable for “Find Children”, you say is working fine as it contains the number of rows of the table. It will work fine as your filter is “”, so it will give u correct number of rows in the table as your tag is “TR” which is Table Row. It does not necessarily indicate the number of arrows(explicitly).
So in the filter, and in the highlight activity, try including the img src selector,so that the robot can look-for/highlight correct arrow. The selector should include “img src”(img src= “https://e-dem.cnrs.fr/jira/images/icons/priorities/low.svg”>) , where in it look for all images which match the said “src”. try using the UIExplorer and sometimes, the img src may not be included in selected elements, so click down arrow below it to show all possible selectors and there the img src should be listed.

1 Like

Ok I see where is my error, thank you for your help !

Just a last question, can I use the filter in the Find Children activity for filtering by two things ?

For my case I have to check if a row has a certain type of arrow (so it’s ok with your help now) and another thing who is a text, not an image, so I use the “aaname” for the selector right ?

But can I put the two things in the same Find Children activity (with “&” or “AND” for example) for checking in the same time if I have the two condition or do I have to do something else ?

After some test it seems to be impossible to use an “AND” condition in a Find Children activity or I don’t have the good syntax.

So, I can output the number of time I have a type of arrow, I can output the number of time I have the other thing I want, but how can I check how many times they are on the same row for each type of arrow (3 types) and each type for the other thing (2 types), the other thing is not an image, it’s like a string.

Yes you could do that. No need of and AND operator. Simply add all selectors say img src="" aaname="" and any number of selectors. But mind it, the robot will select the element only if it matches all the selector you mention. To keep it general, use min no of selectors.

1 Like

@Ludo.F

If you want to use multiple filter in find children, you can refer this one

If it is useful , don’t use filter inside find children and you have to write in for each

Hope this helps

Thanks
Aman sheik

1 Like

That’s the problem, it’s two different element, it’s look like that :

Piro1KLJST

In this screenshot you have 1 red arrow, 3 orange arrows, I can count it now it’s ok.
But I have to check also if on their right we have “Non attribuée” or a name, if it’s a name (like in black) I don’t care but if the robot see “Non attribuée” it had to count it and keeping in mind for which type of arrow.

In this case the good output will be 1 red arrow / 3 orange arrow / 1 red arrow Non Attribuée / 2 orange arrow Non Attribuée.

Btw I can find how much “Non Attribuée” the robot had by using the selector aaname=‘Non Attribuée’

So considering your topic I have to put my condition in the if of my foreach activity ?

And I have to stock the result in a third variable ?

After my two Find Children activity I have a foreach and a if inside for checking if I put a result or not in a excel, so I try to write a condition like that :
P1ChildrenNA.Get(“aaname=‘Non Attribuée’”).ToString AND P1Children.Get(“src=‘https://e-dem.cnrs.fr/jira/images/icons/priorities/high.svg’”).ToString)
But I’m not very good for writing condition so it’s not working, maybe you see where I’m wrong ?

If I were you, I would try to use each condition at a time and check if it works. That way it will be easy to work and catch errors. Only when all conditions are working individually, I would try to combine more than one.

Hello @sawaseem

I can count each things, the 3 types of arrow and the 2 types of text, I can count how many times they appear on the page, this working well.

But I don’t know how to check for each time I count a type of text the type of the arrow in the same row.

The robot has to first count each arrow and after counting how many time it see the special texte, for exemple if it saw 2 special text it has to verify on the row where it found the text what is the arrow next to him on the same row.