Upload File issue in Windows 7 (64 bit)

13 posts, 0 answers
  1. Souvika
    Souvika avatar
    13 posts
    Member since:
    Nov 2010

    Posted 20 Feb 2011 Link to this post

    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

  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 24 Feb 2011 Link to this post

    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!
  3. Souvika
    Souvika avatar
    13 posts
    Member since:
    Nov 2010

    Posted 27 Feb 2011 Link to this post

    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
  4. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 02 Mar 2011 Link to this post

    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!
  5. Carlin
    Carlin avatar
    5 posts
    Member since:
    Apr 2008

    Posted 18 May 2011 Link to this post

    Can you tell me if this has been fixed in the new Test Studio version?   
  6. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 20 May 2011 Link to this post

    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!
  7. Ganga
    Ganga avatar
    37 posts
    Member since:
    Nov 2010

    Posted 10 Jan 2012 Link to this post

    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
  8. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 11 Jan 2012 Link to this post

    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
  9. Ganga
    Ganga avatar
    37 posts
    Member since:
    Nov 2010

    Posted 11 Jan 2012 Link to this post

    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

  10. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 16 Jan 2012 Link to this post

    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
  11. Ganga
    Ganga avatar
    37 posts
    Member since:
    Nov 2010

    Posted 16 Jan 2012 Link to this post

    Hi Cody,

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

    Manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;


    Thanks
    Ganga S
  12. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 16 Jan 2012 Link to this post

    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
  13. Ganga
    Ganga avatar
    37 posts
    Member since:
    Nov 2010

    Posted 16 Jan 2012 Link to this post

    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



Back to Top