开发者

FileUploadDialogHandler()

I am trying to automate a web app which involves selecting an existing file using a fileuploaddialoghandler() method and entering the full path in the file name dropdown then Open click.

However, when I attempt this using this code

FileUploadDialogHandler fileupload = new FileUploadDialogHandler(@"C:\TIFFiles\Testtif.TIF"); //browser.WaitForComplete();

                using (new UseDialogOnce(browser.DialogWatcher, fileupload))
                {
                    newIee.Button(Find.ById("ctl00_WebPartManager1_FileUpload_FileBrowse")).ClickNoWait();

                    browser.AddDialogHandler(fileupload);
                    browser.WaitForComplete();
                    browser.RemoveDialogHandler(fileupload);
                }

It does not work.开发者_如何学运维

What else should I be doing?

Thanks much!

W


I just have one question about your code... What is newIee? I can't tell by looking at the code if newIee is attached to browser. Other than that, your FileUpdateDialogHandler should be fine.

If you can provide the code where you declare newIee, it might add me in determining if it's a factor causing your code not to work properly.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜