This is a migrated thread and some comments may be shown as answers.

Upload File issue in Windows 7 (64 bit)

12 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Souvika
Top achievements
Rank 1
Souvika asked on 21 Feb 2011, 01:31 AM
Hi,

We are having an issue with automated testing of file upload file (this works perfectly in Windows XP). We are using

asp

 

 

:FileUpload control. In IE, the windows explorer dialog opens up to select the file and then it hangs. In Firefox, the dialog doesn't open at all.

Is this issue already noted? Is there any workaround? Is the support for Windows 7 available now?

Cheers,
Souvika

12 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 24 Feb 2011, 10:05 AM
Hi Souvika,
    I've managed to confirm this problem and I've logged it under:
Bug 108981: Upload dialog handler isn't automatically added for ASP: FileUpload control
as you can tell by the name of the bug, a Dialog Handler should automatically be added but this doesn't happen. You can still get this to work by manually adding an Upload Dialog Handler from the GUI (attachment 1). I've also attached a sample test - you might need to upgrade to the lastest WebUI Test Studio version (1421) in order to open it.

Thank you for your feedback, hope to hear from you soon!

Greetings,
Stoich
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Souvika
Top achievements
Rank 1
answered on 27 Feb 2011, 09:12 PM
Hi Stoich,

Thanks for the info. We are using the Webaii framework and not the WebUI Test Studio. What do we need to need add for that?

Cheers,
Souvika
0
Stoich
Telerik team
answered on 02 Mar 2011, 01:59 PM
Hello Souvika,
   this is the code from my test:
FileUploadDialog fileDialog = new FileUploadDialog(ActiveBrowser, "Desktop", DialogButton.CANCEL);
Manager.DialogMonitor.AddDialog(fileDialog);
 
 
Find.ByExpression<HtmlInputFile>("id=PlaceHolderForContents_FileUpload1").Click(false);
 
fileDialog.WaitUntilHandled(5000);

With this code I successfully handled the UploadDialog from this page:
http://www.dotnetfunda.com/tutorials/controls/fileupload.aspx
This code should also work for you, give it a try.

Let me know how it goes!

Best wishes,
Stoich
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Carlin
Top achievements
Rank 2
answered on 19 May 2011, 01:55 AM
Can you tell me if this has been fixed in the new Test Studio version?   
0
Stoich
Telerik team
answered on 20 May 2011, 12:36 PM
Hello Carlin,
     Bug 108981: Upload dialog handler isn't automatically added for ASP: FileUpload control
hasn't been resolved yet. However, I would like to point out that you can successfully handle Upload dialogs now. The problem is only that the Handle step isn't added for you automatically.
 
All the best,
Stoich
the Telerik team
Do you think you know all the new features coming out in Test Studio R1 2011? Think again - we have some surprises and will share them with you in the What's New in Test Studio R1 2011 Webinar on May 12th.
Register Today!
0
Ganga
Top achievements
Rank 1
answered on 11 Jan 2012, 03:02 AM
Hi,

Any update about this bug? I tired with latest Testing Framework version (Testing.Framework.2011.2.1305), but still now luck.....

Thanks
Ganga S
0
Cody
Telerik team
answered on 11 Jan 2012, 06:37 PM
Hi,

When our software developer went to investigate the problem he was unable to reproduce it. The bug was closed on July 5, 2011 with that status.

if you continue to have a problem can you show us how to reproduce it?

All the best,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganga
Top achievements
Rank 1
answered on 11 Jan 2012, 10:32 PM

Hi Cody,

 

Thanks for the quick response.

I am seeing a different behaviour, if I execute the File Upload operation on;

1)      Windows XP and IE 8: The execution was successful as expected. The file is selected and automatically opened.

 

2)      Windows 7 (Enterprise Edition) and IE 8: The execution is not successful. The actual behaviour was; The “Browse” button was clicked successfully, but didn’t chose the file to be opened automatically as expected.  (please refer the attached screen shots)

Testing Framework version: Telerik.Testing.Framework.2011.2.1305

 

This is my code for file upload:

public class FileUpload : BaseControl

    {

        protected HtmlInputFile control = null;

 

        public FileUpload(Element element)

            : base(element)

        {

            this.control = element.As<HtmlInputFile>();

        }

 

        public virtual void SetValue(string value)

        {

            if (!GetEnabled())

                throw new ApplicationException("Control is not enabled for input.");

 

            UploadFile(value);

        }

 

        protected virtual void UploadFile(string filePath)

        {

            // Validation

            if (String.IsNullOrEmpty(filePath))

                throw new ArgumentNullException("File", "Path to File to be uploaded has not been supplied.");

 

            if (!File.Exists(filePath))

                throw new FileNotFoundException(String.Format("File \"{0}\" does not appear to exist.", filePath));

 

            // Set the file path and upload

    control.Upload(filePath, 30000); [Failing at this line...., the browser button was clicked and I am getting an error “Unexpected dialog encountered. Closing the dialog, and halting execution”]

 

        } 

    }

 

 

Thanks

Ganga S

0
Cody
Telerik team
answered on 16 Jan 2012, 09:56 PM
Hi,

Near the beginning of your test please try turning off our Unexpected Dialog Handler feature:

Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;

Kind regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganga
Top achievements
Rank 1
answered on 16 Jan 2012, 10:05 PM
Hi Cody,

I have tried this code also, but still same......

Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;


Thanks
Ganga S
0
Cody
Telerik team
answered on 16 Jan 2012, 11:45 PM
Hello,

I don't know what the problem could be. I verified it works as expected on Win 7 with IE8 using this code:

[TestMethod]
public void SampleWebAiiTest()
{
    Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
 
    // Launch a browser instance
    Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
 
    // The active browser
    ActiveBrowser.NavigateTo("http://cgi-lib.berkeley.edu/ex/fup.html");
 
    // Find the google search box and set it to "Telerik";
    HtmlInputFile input = Find.ByName<HtmlInputFile>("upfile");
 
    input.Upload(@"c:\temp\file.txt", 5000);
}

I don't really know how to use your code sample. Can you send me a complete test that I can load and execute here that reproduces this problem? I can then study it to figure out the cause of the unexpected failure.

Regards,
Cody
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Ganga
Top achievements
Rank 1
answered on 17 Jan 2012, 04:51 AM

Hi Cody,

thanks for the test code.... Its work on Windows 7 and IE 8. So the issue is not related to OS or web browser.

Some issue in my code, but strange. I need bit more time to debug the code. I will update the status based on my test;

Thanks
Ganga S



Tags
General Discussions
Asked by
Souvika
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Souvika
Top achievements
Rank 1
Carlin
Top achievements
Rank 2
Ganga
Top achievements
Rank 1
Cody
Telerik team
Share this question
or