点击下载文件的保存或另存为对话框 [英] Click on Save or SaveAs dialog of file download

查看:320
本文介绍了点击下载文件的保存或另存为对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过几个问题张贴在这个主题,但没有解决方案的工作,这就是为什么我再次发布它。



我使用华廷自动化测试我的网站。使用IE 11.我必须下载并保存文件,但我不能够点击下载窗口的保存或另存为按钮。我试着FileDownloadHandler华廷,但它并没有奏效。
我不局限于华廷唯一的解决办法。它可以是任何东西,我可以在我的C#代码中使用是可以接受的。



  FileDownloadHandler fileDownloadHandler =新FileDownloadHandler(); 
browser.AddDialogHandler(fileDownloadHandler);
browser.Image(Find.ByAlt(Download.C​​sv))祖先(一)ClickNoWait()。;
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(40);
fileDownloadHandler.WaitUntilDownloadCompleted(200);


解决方案

我使用IE 11,并能够下载和关闭对话框



使用IE浏览器中的11文件下载自动化C#


I have seen couple of question posted on this topic but none of the solution worked that's why I am posting it again.

I am using WatIn to automate the testing of my website. Using IE 11. I have to download and save the file, but I am not able to click the save or saveas button of the download window. I tried FileDownloadHandler of WatIn but it didn't worked. I am not limited to WatIn only solutions. It could be anything thing which I can use in my C# code will be acceptable

FileDownloadHandler fileDownloadHandler = new FileDownloadHandler();
browser.AddDialogHandler(fileDownloadHandler);
browser.Image(Find.ByAlt("Download.Csv")).Ancestor("a").ClickNoWait();
fileDownloadHandler.WaitUntilFileDownloadDialogIsHandled(40);
fileDownloadHandler.WaitUntilDownloadCompleted(200);

解决方案

I am using IE 11 and was able to download and close the dialog box

Automate of file download in IE 11 using c#

这篇关于点击下载文件的保存或另存为对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆