Keyword is taking way too much time to timeout when expecting an error

I am saving many files in my file explorer, and if each file already exists in the location it is saved, I want to overwrite the existing file. Otherwise, I would like to continue on failure if the overwrite file pop-up does not show (aka the file does not yet exist).

Here is my code:

As shown in the images, I am setting the Global Timeout time to 0.5 seconds before my keyword that I expect to fail.

This is being registered in my task log, but the task is still taking about 10-15 seconds to finish when the keyword fails which is severely delaying my process.

This is my task log:

The error took 26 seconds here to then move on to the next task.
I have tried editing the timeout argument and the wait_time argument and it is still not working.

This process saves about 50 files per run, so the price on this automation alone is heavily affected by this. I would appreciate any suggestions.

Maybe instead of using UI, you could just move those files instead: OperatingSystem library | Robocorp documentation

Should be much faster this way. But of course, I don’t know your use-case.

1 Like

Hey @jippo thanks for the response! This would work but is a lot more complicated with my use case.

I am clicking an “export” button on a website which prompts the save as dialog.

Theoretically I could download each file, wait for that file to finish downloading, get the name of the file, and then move the file and rename it.

Or along those same lines: set my default download directory to the folder I want, download it, wait for the file to finish downloading, and rename it.

I would rather avoid that considering my logic is built and the only issue left is the timeout argument not working. However that is my backup plan. I’m just confused as to why there’s such a long delay for the action to timeout.

Hello @dburkhart !
Could you please try with a timeout for the specific keyword instead of global timeout?
It would look like this:

My Keyword
    [Timeout]    1 minute

Please try this out and let me know if it works

1 Like

Hi @bogdan,

I was playing around with this and it makes the keyword timeout. However, it ends the entire process.

I tried it with Run Keyword and Ignore Error, Run Keyword and Continue on Failure, and in a try-catch but it still stops the entire execution.

Run… keywords are on catching errors caused by timeouts. I tried with try/except and execution did not stop for me.
edit: checked again and with [Timeout] does break try/catch

1 Like

I appreciate the help, I think I’m going to go the operating system route as @jippo first mentioned. Thanks again for the efforts!

2 Likes

This is the way to go