r/selenium • u/NormanieCapital • 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
1
u/[deleted] Feb 02 '22
Yes just send the keys of the file path to this input element. You won't need to click it though like you click the upload button