Scroll down on a box, find an element that contains a given variable and double click on it

Hi, I’m trying one of the solutions proposed on topic “Info about scroll down a scroll bar if a specific string is not found” on a similar case where I’m having problems, I tried the Find Children activity as @supermanPunch proposed but I’m having “UiPath.Core.UiElement” as results, how can I translate/convert this to work with it as a string or something similar (for example: “Access to multi-company information”)?

That’s my scrolling region:

I need to search on that field for the role line that contains the Cost Center code of the user (for example: 8115 ) that is stored in a variable, and, once found the line that contains the cost center code, double click on it to add it to the user roles.

With Find Chldren I obtain “UiPath.Core.UiElement” I need it to be a string where I could search for my cost center code and double click on the match line, is this possible? :sweat_smile:

For additional info, if it can help, when I do a Get Full Text it extracts the information like this:
image
ROLE NAME
ROLE DESCRIPTION
150=0
ROLE NAME
ROLE DESCRIPTION
150=0

I need to search the cost center code on the role descriptions.

1 Like

Hello @Airun,

Good Day!

Can you try this

  • I hope it always starts from the Top so, use screen scrapping Activity to get the text and use if condition like this

    screenScrapVar.Contains(“8115”)
    Then
    Click on it

or else
you can send hotkey “PageDown” and scrap again check if the Cost Center Code contains in that
particular screen or not

Cheers
@Airun

1 Like

I suppose you mean the “Get Full Text” activity inside “Screen Craping” menu, the output of this activity is a single String so, all the lines on my roles list are beeing stored in a unique string (as with the normal “Get Full Text” activity), I can’t loop on it to double click on the specific role line that matches the condition. If I set it to click on the ScreenCrap variable if this variable matches 8115, it will click on the whole field, not in the specific line that contains 8115.

I’ve tried to use the “Extract Structured Data” activity but it requires something named “ExtractMetadata” I don’t know what is it or how to fill it.

I’ve also tried the “Find text position” activity but it always give me: “Text was not found” (I’ve tried searching for “8115”, “8115”, “CTDocumant” and “CTDocumant” without success).

I’ve also tried “Find OCR Text Position” activity, it’s not enough, it finds text only if it’s shown on the visible part of the field (I can also do it with a “Find image” activity) and, once found the text, the UiSelector given is the full field, so it don’t points to the specific line where I need to click on.

I can maybe use the scroll (if a learn how to do it, I don’t find a “PageDown” option on the “Send Hotkey” activity) to move on the list and use a “Find image” activity each time I go a bit down, but it’s very complex to search a simple role, I think we will let this part of the process to be done manually. :pensive:

I’ve tried again with “Find Children” as proposed by @supermanPunch with a “Highlight” activity (even if I still need a way to filter the correct line to click on) but I wanted to check if at least, the UI elements are beeing found correctly, I also have a problem with it, it finds it but don’t scrolls to it, I have the error message: “The UI element you are trying to highlight is valid, but not visible.” I don’t know if I use one of those UiPath.Core.UiElement in a click activity it will be able to click on it or it will throw the same error :sweat_smile:

Okey, I’ve found a way to move down on the list, if I click on each element (on the For Each activity looping the elements found with the “Find Children” activity), when it clicks on the last element it moves a bit the list so the next one is visible and UiPath is able to found it and click on it and so on. But I still have a big issue with this: I think we have more than 300 lines on this field, if the automation must click on lines one by one to it be shown to check if it contains the cost center or not it takes too much time so it’s still not a good solution.

I think it will not be possible to automate this, Agresso is a very difficult tool for automations… :sob:

@Airun Have you checked the Selectors of any one of the items in the List in the Above Image you have provided?

Do you just want to Double Click on the list value which contains the cost center that you need, Then I’m not sure if you will really be needing the Find Children Activity.

Can you use a Click Activity on one of the values, mostly the cost center 8115 which you need. Check it’s Selectors in UiExplorer and send it’s Screenshot here.

1 Like

I’ve taked the specific selector of the 8115 role, I have this:

When I launch the click activity on it, if the role is shown on the field, it clicks on it ok, but if not, it clicks anyway on the screen and it ends. As you can supose seeing the size of the scroll bar on the right of the field, we have a lot of roles, so I need that UiPaths searches on roles not visible, it’s impossible to always show the role to be used on the visible part of the field. :worried:

image

Ah, little annotation, I don’t know if it can have influence on this issue but I indicate it just in case: when I open the “UI Explorer” for elements located on the “User Master File” Agresso window it takes a lot of time to load and it blocks frequently while using it (when I try to highlight the Visual tree elements). For other elements I’ve interacted with (in other Agresso windows or in other appliations/tools) it’s very fast.

@Airun Yes. I guess it is dependent on the application that you are using. You can try to open the Selector in UiExplorer and Check if there’s any attribute that matches the Value that you need such as “8115”. If you are able to find it, then we may just be able to loop through the Roles One By one, Check if it is the Role you need, and finally use click Activity on the right role.

I am not sure, but maybe Manually can you just Type on the Window field of that role, and check if the Roles get sorted according to what you have typed ?

1 Like

Thanks @supermanPunch I’ve tried but it’s not enough. I can find things on selector that identify the specific role (for example, I can take its “text” property that contains the cost center code and replace with the variable to found the correct one for each execution) but I still have the same issue, if the role is not in the visible part, it don’t find it, even if I don’t replace the text, when I search for the original one it don’t fin it neither, it find it only if it’s on the visible part of the field when the automation is executed.

I can also type on the field, for examplo, for basic roles that are added to all employees (EMPLOYEE and QUADOC) I type the firts letter (“E” and “Q”) to have it visible on the screen and, once visible I double click on it to add it to the employee. The problem is that for the cost center roles I can’t do this (for new ones yes because I changed the way we create cost centers in february) but all the cost center roles that where existing before don’t have the code on the ID so I don’t have any valid data that I can use to search it.

To better explain it:

  • On those field we caan see two data elements about roles: their ID (on theleft) and their description (on the right).
  • When we type on the field to search on it, we can only search by the ID (info on the left).
  • Cost Center roles were beeing created with not much sense before I start working on this company, they where using a sort of short descriptions that don’t always follow a specific rule (For example, for cost center 1022 wich is Madrid Engineering the ID is CC MADRENGIN, where we have MADR for Madrid and ENGIN for Engineering, for cost center 1023 that is Madird Management the ID is CC MADMANAGE, where we have MAD for Madrid (instead of MADR as on the first case) and MANAGE for Management, for cost center 1520 that is Manufacturing Toulouse the ID is MANUFTOU so here we have MANUF for MAnufacturing and the city Toulouse on last position TOU instead of beeing first as for the other two roles).
  • We have more than 100 or 150 cost center roles.
  • We cannot modify the ID of the roles, only the description can be modified. To have the cost center code on the ID of the roles we must delete all our current roles, create all again with the new IDs and check/reconnect all the things that are working with roles on our system (except of the 4 last roles that I’ve created with the new nomenlcature CC 1824 for example). So, for the moment, this is not a possibility to change the IDs. :sweat_smile:

If there is not possible that UiPath finds the lines when not on the visible part of the field we will not automate this part of the process. :sweat_smile:

Hi @Airun,

is pagedown send hotkey working in that scenario?

if yes you can try like this

  1. use an element exists (which contains the dynamic selector for that value)
    2.if that is found then use click with dynamic selector.
    3.The above two steps need to be in Do While and condition is Element Exists Output variable need to assign as False(if that element exists is true it will come out of loop)
    or it will try until it find that particular value. make sure u surround this with try catch so there would be no errors for next iteration.

Give it a try and let us know.
Happy Automation!
Regards,
Aditya

1 Like

Hi @desineediaditya I don’t know hot to use the pgdn I’m trying it but it don’t do anything, I suppose I’m doing something wrong. Maybe wrong element selected (I can select the whole field, only the inside part, the scroll bars…Additionnaly, as it is very difficult to interact with this window with the UiExlorer each little test takes me a lot of time, it’s super slow and it frequently blocks before I can do anything and I must to close it by task mnanager and start again :pensive:

What of those selectors must I use for the pgdn? I must change any other property of the send hotkey activity in order that the pgdn works?

image

Hi @Airun ,

By seeing at your screenshot i was just thinking if you click on those two arrows beside scroll bar will it navigate to other names?

Regards,
Aditya

Hi @desineediaditya! Yes, I suppose that clicking on arrows it can work, nevermind, thanks to your previous comment of using pgdn, I’ve found another way to go down, using the key “down” with a type into field before. It seems to work, but now I’m having problems with the while condition :sweat_smile:

I’ve tried for the moment by using an “Element Exists” activity that checks the selector:









And exits the variable RoleFound, so I’ve set my while condition as RoleFound = False
But RoleFound is always true because the selector is found even it’s not visible on the screen :sweat_smile:

But even if the selector is found, if I put a “Click” activity to click on:









It only performs the click correctly if the element is visible, if not, it clicks on the top left corner of the application :sweat_smile:

Is there any activity that checks if element is visible on screen (but not an image because the roles will always be different so I need it to compare the text)?

Hi @Airun
can u share the selector in element exists?
Regards,
Aditya

Sorry I pasted the text on my last comment but this is not visible, I paste it as image:

Hi @Airun,

Remove the idx values from selectors and the unnecessary selectors as well.
try making it simple as we need the table where it is looking and the text value which is looking that’s it.

Try this and share the selector screenshot
Regards,
Aditya

I’m sorry, this is very slow, I’ve just customized the elector, I will try like this and I feedback:

From another side, before reading your last post, I was peerforming other tests with the While activity and the “down” hotkey and it’s working, but it’s very slow, it taked 4:14 minutes to find the role :sweat_smile: but this is better than nothing!! If we don’t find anything better I know that at least it will work like this even if it’s a bit slow, thank you for all the help you are giving me!! :blush:

1 Like

With the selector I shared you I still have the same issue: Found only if visible, if not it clicks on top left application corner.

This is what is working, a few slow but it works:
image
image

1 Like

Hi @Airun,

You did it different way that is good and give a try for the process i am listing down as well

1.Take a do while inside of do while take element exists
2.Now if the element is found then click else use send hot key to go down
3.In do while condition make it as element exist output variable=False(if element is not found it is False at element exists. so(as the condition is true do while loops back), it loops back again to check the element exists again and repeats the process again until it find the element)

give a try with this.
Happy Automation!
Regards,
Aditya

With element exists it don’t works because the element exists gives always true, UiPath always knows that the row exists but he is no able to click on it since it’s not on the visible part of the screen so I need to go down on the list since the row is visible and then, I can click on. With the “down” hotkey and the “Find Element”, even if it’s a bit slow but at least it do it, I think I will use this method, htanks for the help!! :smiley: