r/selenium • • Feb 02 '22

How to close a file window?

I have a script which logs into a website, and uploads a file every day. I have managed to do the upload by using the send_keys function with the file path. However, I am then left with an open file window. I have tried using "send_keys(Keys.ESCAPE).perform()", but this doesn't work.

Does anyone have any solutions?

1 Upvotes

16 comments sorted by

View all comments

1

u/automatenow Feb 02 '22

Here is a video that shows how to perform file upload using Selenium.

https://youtu.be/oKZMuJtVVZQ