This question is locked. New answers and comments are not allowed.
Greetings!
We are having a few problems using the file upload handling dialogs in Sharepoint 2007.
At a certain point in our tests, we need to upload a file into a document library. To do this, we have recorded the necessary steps
to press the "Upload" and "Browse" buttons and we have also added a file upload handling dialog.
The file upload handling dialog is configured to always insert a file path similar to this: "C:\DocTeste\Documento1.docx".
Unfortunately, these actions do not always work. Instead of inserting the configured file path, the file upload handling dialog seems
to "stutter" and insert only a fraction of the full path, or it duplicates the full path.
We have gathered a few screenshots detailing the sort of erratic behaviour that we are getting. It does not seem to be a problem with the
actual code, since it does work *sometimes* !
Below you will also find a sample of the file upload handling code (we have converted it into a NUnit test).
What is causing this erratic behaviour? Is it a framework problem?
What can we do to work around this problem? Since the file uploads sometimes fail, the whole tests fail...
Thank you very much for your attention,
André Silva.
We are having a few problems using the file upload handling dialogs in Sharepoint 2007.
At a certain point in our tests, we need to upload a file into a document library. To do this, we have recorded the necessary steps
to press the "Upload" and "Browse" buttons and we have also added a file upload handling dialog.
The file upload handling dialog is configured to always insert a file path similar to this: "C:\DocTeste\Documento1.docx".
Unfortunately, these actions do not always work. Instead of inserting the configured file path, the file upload handling dialog seems
to "stutter" and insert only a fraction of the full path, or it duplicates the full path.
We have gathered a few screenshots detailing the sort of erratic behaviour that we are getting. It does not seem to be a problem with the
actual code, since it does work *sometimes* !
Below you will also find a sample of the file upload handling code (we have converted it into a NUnit test).
| public void uploadfile() |
| { |
| // Launch an instance of the browser |
| //Manager.LaunchNewBrowser(); |
| //Manager.Elements.ReturnElementProxyWhenNotFound = true; |
| // Handle 'FileUpload' dialog. |
| FileUploadDialog fileDialog = new FileUploadDialog(ActiveBrowser, |
| "C:\\DocTeste\\Documento1.docx", |
| DialogButton.OPEN); |
| Manager.DialogMonitor.AddDialog(fileDialog); |
| // Start Dialog Monitoring |
| Manager.DialogMonitor.Start(); |
| // Click 'a_Zz19_UploadMenu' |
| HtmlAnchor a_Zz19_UploadMenu = Pages.OriginList.a_Zz19_UploadMenu; |
| a_Zz19_UploadMenu.Wait.ForExists(100000); |
| a_Zz19_UploadMenu.Click(false); |
| // Click 'input_File_Plac__InputFile' |
| HtmlInputFile input_File_Plac__InputFile = Pages.Upload_Document.input_File_Plac__InputFile; |
| input_File_Plac__InputFile.Wait.ForExists(100000); |
| if ((ActiveBrowser.BrowserType == BrowserType.FireFox)) |
| { |
| ActiveBrowser.Window.SetFocus(); |
| input_File_Plac__InputFile.ScrollToVisible(ScrollToVisibleType.ElementTopAtWindowTop); |
| input_File_Plac__InputFile.MouseClick(); |
| } |
| else |
| { |
| input_File_Plac__InputFile.Click(false); |
| } |
| // Wait Until Dialog is Handled. |
| fileDialog.WaitUntilHandled(5000); |
| //Remove dialog handler as mentioned by telerik |
| Manager.DialogMonitor.RemoveDialog(fileDialog); |
| // Click 'input_Button_Pl__BtnOK' |
| HtmlInputButton input_Button_Pl__BtnOK = Pages.Upload_Document.input_Button_Pl__BtnOK; |
| input_Button_Pl__BtnOK.Wait.ForExists(100000); |
| input_Button_Pl__BtnOK.Click(false); |
| } |
What is causing this erratic behaviour? Is it a framework problem?
What can we do to work around this problem? Since the file uploads sometimes fail, the whole tests fail...
Thank you very much for your attention,
André Silva.