0

I have created a .Net C# application in 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.

1 Answers1

0

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.

prostynick
  • 6,129
  • 4
  • 37
  • 61
  • Thank you very much for your reply.Can anyone help me by giving some sample codes how to use dialogwatcher to solve my issue? – Narain Kartha Dec 15 '10 at 07:56
  • See this: http://stackoverflow.com/questions/4455607/watin-and-net-winforms-webbrowser-control-is-dialogwatcher-possible/ – prostynick Dec 16 '10 at 14:38