How to know if a download of a file has occurred with Selenium webdriver in python


I'm doing a test that downloads a file. This already occurs, but my question is that if there is any way to verify that the download has been successful.


asked by Thenine 26.11.2018 в 16:21

1 answer


With basic Python commands you can check the contents of a directory. For example:

contenido = os.listdir("mi_path")
"nombre_archivo_descargado" in contenido

The last line returns a boolean and you can use an Asset to ensure automatic operation.

answered by 27.11.2018 в 08:58