How to modify selector for click activity to select specific file in folder?

Hi all,

Currently, I am trying to use click activity to select a particular file base on the 8 digit date in a folder (example: selecting the file that contains “20191130” in the name). There are 2 files “COAMAL_W_20190930_09.xml” and “COAMAL_W_20191130_09.xml” in the folder.

Noted that if the files are in the desktop, I can replace the selector (ctrl name='COAMAL_W_20191130_09.xml’ role=‘list item’) with (ctrl name=‘date’ role=‘list item’) with date being a changing string variable that will contain “20191130”. ( wildcard is added to date ) By doing so the click activity is able to select the correct file COAMAL_W_20191130.xml.

<wnd app=‘explorer.exe’ cls=‘WorkerW’ idx=‘1’ /
<wnd cls=‘SysListView32’ title=‘FolderView’ /
<ctrl name=‘COAMAL_W_20191130_09.xml’ role=‘list item’ /

However when the files are placed in a folder , I have changed the same ctrl name = ‘Items View’ to ctrl name = ‘date’, the click activity is unable to determine which file to click. I understand that ctrl automationid=‘0’ in the selector is pointing the click activity to select the first file. After omitting the tag, the click function still does not select the file with “20191130”.

<wnd app=‘explorer.exe’ cls=‘CabinetWClass’ title=‘downloadFiles’ /
<wnd cls=‘ShellTabWindowClass’ title=‘downloadFiles’ /
<wnd aaname=‘Explorer Pane’ cls=‘DirectUIHWND’ /
<wnd aaname=‘Shell Folder View’ cls=‘SHELLDLL_DefView’ title=‘ShellView’ /
<wnd aaname=‘Items View’ cls=‘DirectUIHWND’ /
<ctrl name=‘Items View’ role=‘list’ /
<ctrl automationid=‘0’ /
<ctrl automationid=‘System.ItemNameDisplay’ /

Which part of the selector above do I need to modify to add the variable ‘date’ (with wildcard) that contains “20191130” to get the click activity to select COAMAL_W_20191130.xml?![image|690x227]

Thank you all.

hi @AaronTan

Ctrl name=‘*+CDATE(YYYYMMDD).ToString+’"

Check this selector

Thanks
Ashwin S

Hi AshwinS2, thank you for your response but changing to the your selector does not solve. If I am correct, CDATE is used to convert a variable into a date format such as dd/mm/yyyy.

from the below selector, note that (ctrl automationid=‘0’ /) is the portion telling which file to click. “0” meaning that the first file from the top will be clicked. If its “1” it means the second file will be clicked. Tried omitting this part of the selector.

Even if I change the (ctrl name=‘Items View’ role=‘list’ /) to the full name of the file (ctrl name=‘COAMAL_W_20191130_09.xml’ role=‘list’ /), it still does not click on the file that I want in the folder.

<wnd app=‘explorer.exe’ cls=‘CabinetWClass’ title=‘downloadFiles’ /
<wnd cls=‘ShellTabWindowClass’ title=‘downloadFiles’ /
<wnd aaname=‘Explorer Pane’ cls=‘DirectUIHWND’ /
<wnd aaname=‘Shell Folder View’ cls=‘SHELLDLL_DefView’ title=‘ShellView’ /
<wnd aaname=‘Items View’ cls=‘DirectUIHWND’ /
<ctrl name=‘Items View’ role=‘list’ /
<ctrl automationid=‘0’ /
<ctrl automationid=‘System.ItemNameDisplay’ /

Hi @AaronTan

Please do see are you able to view the ctrl aaname=*

Thanks
Ashwin S

Hi ashwin, there is ctrl name but no ctrl aaname, the full selector is what you see in my prev reply.