How to Identify file name?

I’m trying to download reports from a web portal, which sometimes gives one file and other times two (Balance file and Transaction file). When I click the download button, a file save dialog appears, but I can’t find any attribute that indicates the file name to decide which file it is. How can I identify the file type and rename/save it accordingly? Any suggestions would be appreciated.

@Anil_G

Hi @pravin_bindage

try before clicking download, use directory.getfiles activity to list files in the download folder. after download, list files again to find new ones. use if or switch activities to check file size or read file content with read text file or excel activities to identify the file type. then use move file or rename file to save with the correct name

Happy Automation

1 Like

if you are using chrome
Check the Settings → Show Advanced Settings → Downloads section. Un-Tick the “Ask where to save each file before downloading” option. And try

After download most probably you can identify what type of file it is depending on file name or File type or file contents.

1 Like

It may affect other process

In that case save it my any name after downloading identify file type depending on file content.

1 Like

@pravin_bindage

  1. Does the name appear on ui? If so check there using get text
  2. If not download and read the file may br a specific cell or so

Cheers

1 Like

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