Level 3 Excercise 3 Generate Yearly Report, Saving File problem


#1

Hi All,

In the Generate Yearly report excercise you download a monthly report, save it into a temp directory (using a path that you have generated using the path.combine function and ‘save as’.

My problem is that even though I generate a valid path (as far as I can see) the file gets saved into my downloads folder (or whatever folder is the default folder when you open the save as file dialog) .

This is a problem as firstly, I’d obviously like the file to be saved where I want it to be not some random folder (current default) and secondly the temp folder is chosen so that in other parts of the process it can be destroyed and recreated empty to make sure that it’s ‘clean’ and I don’t want to be forced to do that with my downloads folder.

Here is my xaml (you’ll need to change the in_TaxID argument default value to a valid one for your data set)

System1_CreateYearlyReport.xaml (27.4 KB)

and here is what happens.

1 The data is fed in to the Download Monthly Report page (needs to be open) https://www.acme-test.com/reports/download

  1. The Download Report button is pressed and a pop up opens with options (open, save, save as)

  2. Save As is selected and ‘naturally’ opens at my downloads directory (you can see a report Report-R0212121-2017-1 has already been saved in there for some reason)

  1. The correct path for the file is entered and save is pressed and a message box appears saying that the file already exists (I think it is referring to the file in the downloads folder as if I delete that the save works)

In fact what is happening is that it always tries to save in the ‘Default’ path location.

The ‘default’ folder is the last folder that a file was saved into using the filedialog window. So if I manually hit the Download report button

image

and save it to My documents folder for example

next time I go to download the file and save as the file document folder will default to documents.

This shouldn’t be an issue as when the path is entered into the file name field the file should save there but it doesn’t (maybe there is a delay problem in that the save is occuring before the file name field has had a chance to be filled)

Going to put a delay of 2 secs in and see if that helps after the file name field is entered and before the save button is pressed.

That didn’t work and I should have known it really as once the workflow has got to the saving file point (in debug mode) and I even try to save the file manually (you can see it’s defaulted to the Data folder but the path in the file name field is the Temp folder, one level further down, which does not contain the file)

It is referring to the file existing in the data (default folder) and not the temp folder which is empty.

Does anyone have an idea what is going on here. It may even be more of a windows issue than UiPath but it still makes no sense

Additionally (using a different filename as had to reset data), if I manually change the name the file saves down fine into the temp folder (I really don’t get it!). See below

original pathname and press save (even though Temp folder empty) causes message that file already exists (it’s talking about the file in the data (default) folder).

but if I manually change the name (add -TEST to it) still saving in temp folder it saves down fine.

I know this is a long post but this behavior makes no sense to me.


#2

@charliefik Create new folder and try once again


#3

Thanks for the suggestion but unfortunately it continues to do the same thing.

I deleted the temp folder. Created a new temp folder and re-ran and I get the same issue.

To recreate this issue you need to save a report in a file other than temp (so that the default folder is wrong) then run the process once (it will fill the default folder with the files rather than the temp folder which will remain empty). Then rerun the process and you should notice that the message that the files already exist (but the temp folder is empty, it is complaining about the files in the default folder which is not where you are trying to save them to)

System1_CreateYearlyReport.xaml (28.3 KB)

also reports download page needs to be open

https://www.acme-test.com/reports/download

and a valid TaxID needs to be entered into the argument in_TaxID default field (from your data set)


#4

Hi, Is the SimulateType in typeinto activity is checked? If yes, it will save in the default folder you specified in your browser which I think is Downloads folder with the default name of the file.
I suggest to unchecked the SimulateType property and add some delaybetweenkeys (10 or 20); and try if it is working now.


#5

@Jaycee_Salvador it was definately the SimulateType property being ticked which was causing the issue. I think it was saying in the walkthrough that simulate tick should be ticked to enable it to work in the background and I got carried away and ticked simulate type in the type into activity.

Workflow is still not working as there seems to be an issue with the find element when it is going to close the download window (but I’ll look into that)

Thank you so much for that insight although I don’t really understand why by having it ticked the path to the folder is ignored and the default folder is used

image

How did you know that was the problem (you genius!).


#6

On my observance the Save As file dialog needs an interaction to save the file in the defined path, so the when you ticked the SimulateType its like working in background unlike if it is unticked it’s keying the path character per character.
Actually, it’s been my challenge for a long time since I want to have it run in background but you can’t with Save As file dialog. But to shorten the typing of the bot, I’m putting the string in clipboard and then I just put keystrokes “ctrl+v” which is less prone to error than typing it character per character.


#7

Thanks again Jaycee great explanation