How to close the browser's Open File dialog after uploading a file?

I created a simple script to upload a file using the Record feature.

And if I execute this with speed = fast (default) the Open File browse’s dialog remains open. However, if I execute this with speed slow or semi-slow, the dialog closes. The same happens in Edge and Chrome. Also, when executing slow I can see in the Dev Tools:
image

What is the proper way to close the dialog? When selecting the file I tried either double-clicking the file, and selecting and clicking on the Open button. Both methods generate the same script.

Logs are slightly different. Slow:

Fast:

As you can see in the last image the test case is passed, and I can see the file already uploaded, but the line with the name of the file (among other lines) does not appear in the log. It sounds like a sync problem.

Thanks!

At a guess, you’re clicking on the button via Katalon Recorder to open up the file browser. Don’t do this.

Only use the type command you have to pass the file system path + filename to the DOM element used for uploading. The type command doesn’t require the file browser to be open (and helps it in no way).

Great! Thank you so much. The solution was easier that I thought. And yes, you are right, I was clicking the open dialog manually.

No problem :slight_smile: Glad that it fixed your issue!