FileUpload Dialog

With FileUpload, you need to pass in the full path to the file to upload and how the dialog should be handled. Your options for FileUpload are: DialogButton.OPEN, DialogButton.CANCEL or DialogButton.CLOSE.

// Add a FileUpload dialog to be monitored.
Manager.DialogMonitor.AddDialog(new FileUploadDialog(ActiveBrowser,@"C:\EmptyTextFile.txt",DialogButton.OPEN));

// Given that there were no dialog attribute set, the manager will not start the monitoring.
// You need to invoke the monitoring
Manager.DialogMonitor.Start();

// Cause the upload Dialog to pop-up
// With Firefox, it is not allowed to pop the dialog using script due to security restrictions.

//Click a button which triggeres the dialog

Pages.YourSite.YourButton.Click();

// Dialog should be automatically handled
' Add a FileUpload dialog to be monitored.
Manager.DialogMonitor.AddDialog(New FileUploadDialog(ActiveBrowser, Path.Combine(Globals.PATH_TO_PAGES, "..\SupportFiles\EmptyTextFile.txt")    , DialogButton.OPEN))

' Given that there were not dialog attribute set, the manager will not start the monitoring.
' You need to invoke the monitoring
Manager.DialogMonitor.Start()

' Cause the upload Dialog to pop-up

Pages.YourSite.YourButton.Click()

See Also

o compile the above code include the following using:

using ArtOfTest.WebAii.Win32.Dialogs;