WatiN embedded in web browser control not showing dialog window
I have created a .Net C# application i开发者_Python百科n which I have embedded the WatiN inside the webbrowser control.Following is my code
Settings.AutoStartDialogWatcher = false; IE ie = new IE(WebBrowser1.ActiveXInstance);
This works fine for all controls except for FileDialog. When automating the FileDialog control, the code is as below
ie.FileUpload(Find.ByName("Fileupload_1")).Set("c:\test.pdf");
When this code runs, since the dialogwatcher is not available, it shows an error.
Please help me on this. Thanks in Advance.
I haven't used this approach with file upload, but assuming that this fails because of dialog watcher absence, create your own dialog watcher to handle dialogs of your winform. It is not too hard to rewrite original dialog watcher. Unfortunately, I can't find my code to help you directly.
精彩评论