Selecting invisible elements


#1

Hey, I’m new here, so please be gentle :upside_down_face:

I’m working on a somewhat artificial example for UiPath to get my feet wet:

The objective is to open Windows notepad, open the file open dialog, move to a directory crowded with hundreds of files and select a file which is not visible without scrolling. The name of the file is known.

The basic question is: Does a list element has to visible to be addressable with a mouse click?

I know there are several workarounds to achieve the goal like using the provided textfield to enter the file name, but that’s not the point. I’m more interested in the general pattern for dealing with lists which have to be scrolled through to find elements in a dynamic contents.

What the best practice here?

Thanks
Jan


#2

Hi @jan.bernhardt
Just a question: are you doing these actions to open a file? If so, you can achieve this by the activity “Start process” and pasting the file path in the first empty line (FileName).


#3

Hi PAD,

Thanks for the reply. I know that there are several ways to achieve the same goal but I took this only as an example where everyone can reproduce the task since everyone should have notepad installed. It is an example for the general problem where you have lists longer than the screen and want to select non-visible items. I was looking for best practices for that problem when there’s no workaround or shortcut.


#4

The Select Item activity.


#5

This is what I tried first, but it only works for visible elements.


#6

I guess it might depend on the application.

If you go to https://www.fakenamegenerator.com/advanced.php and use a Select Item activity it will get the entire list and allow you to set up nationalities that are not visible on the screen (like Ninja for example).

Are you in a CITRIX env ?


#7

No, I’m running plain Windows 7 and I’m using the stock notepad and the default file open dialog.


#8

Hi, some solution was suggested e.g. here:


#9

Hi PAD,

Thank you for your answer.

I’m not working on automating websites but desktop applications.

From what I tried and by what suggestions I got, I come to the conclusion that there’s no good best practice on how to access non-visible data in desktop apps. I guess I have to iterate through such lists e.g. by clicking into the list and use the cursor keys to scroll through the content until the items I look for become visible.


#10

Hi @jan.bernhardt

This depends on the particular application, but you are generally correct. Some apps are more tricky than others, with java ones being notorious for not allowing one to scrap the out-of-screen text.