How can I upload a file using watin? I searched and tried a lot, but I can’t get it. I just want to click the link that has the download and save it. I used examples that I found, but to no avail. The problem is that I use "WaitUntilFileDownloadDialogIsHandled (15)", but a 15 second pass, as well as an exception and an exception: WatiN.Core.Exceptions.WatiNException: the dialog is not displayed after 15 seconds.
This is the code:
FileDownloadHandler download = new FileDownloadHandler("C:/Development/Test/Downloads/" + "excel" + ".xls");
using (new UseDialogOnce(browser.DialogWatcher, download))
{
browser.Button(Find.ById("id_of_the_button")).ClickNoWait();
download.WaitUntilFileDownloadDialogIsHandled(15);
download.WaitUntilDownloadCompleted(150);
browser.RemoveDialogHandler(download);
}
Please, help!
source
share