开发者

WatiN: How to Run the exe file instead of Saving it from the FileDownloadHandler

I am new in u开发者_Python百科sing WatiN and couple it with C# for my automation needs. I am faced with a situation here. I need to run an executable from a server location. After having clicked on the download link in the IE, I have a file download pop-up in front of me and a "File Download - Security Warning" on top. The UI presents me with 3 options of Run, Save and Cancel.

I want to click the Run button to run the exe directly (and not hit Save to download it to some location). I have added the dialog handler for my filedownloadhandler to my IE instance. Please find the screen-shot attached

Is there a way in WatiN to accomplish this? Any sample code is highly appreciated.

Thanks.! Capture Run


Try this

Use your existing dialog handler add and remove but the type of handler you would add would be

WatiN.Core.DialogHandlers.FileDownloadHandler dialogHandler1 = new WatiN.Core.DialogHandlers.FileDownloadHandler(WatiN.Core.DialogHandlers.FileDownloadOptionEnum.Run);

Note that this won't work with IE 9. I have an open post on this (Download Handler for IE9). Hope this helps.

Cheers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜