FileUpload Control not working in IE9

2 posts, 0 answers
  1. Zabeer Jainullabudeen
    Zabeer Jainullabudeen avatar
    1 posts
    Member since:
    May 2010

    Posted 12 Aug 2011 Link to this post

    Hi,
      We have a website that I am trying to automate. Basically there is a Html Input File control and its textbox is disabled. I need to click on its 'browse' button, navigate to the right file location and open a file. Once this is done, I need to upload this file.

    We have been using WebAii 2010.2 version for our automation. We wont be able to upgrade to the newer version of the webaii suite. I managed to get this automated and everything seems to work fine on IE8 in Windows 7. But When I try to run this on IE9 on Windows 7, the file dialog opens and then right away closes. below is my code snippet

             
          #1      _manager.Settings.UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle;
     
                _manager.DialogMonitor.AddDialog(new FileUploadDialog(_manager.ActiveBrowser, fileNameToUpload, DialogButton.OPEN, "Choose File to Upload"));
                _manager.DialogMonitor.Start();
                _manager.ActiveBrowser.WaitUntilReady();
                HtmlInputFile updlg = _manager.ActiveBrowser.Find.ById<HtmlInputFile>("ctl00_MainContent_FileUpload1");
           #2     updlg.Click();

    when I comment line #1, the dialog opens and right away closes. When I leave line #1 uncommented, then the dialog opens, after a couple of secs, it flickers,
    then it flickers, then it stays there forever without moving to the next line of code.

    for line #2, updlg.MouseClick() doesnt seem to do anything.


    But all of this works fine in IE8!!! Can you guys tell me if there is any way this can be made to work in IE9? If that
    is not possible, then is there an Add on for newer versions for Firefox?

    When I try firefox, I see it open the window, but nothing happens and the address bar has this text: "about:blank?!!AOT2.0!Pipe.ArtOfTest.WebAii.BrowserProvisioner_517858088"



    Am i missing some steps in setting up firefox?


  2. Anthony
    Admin
    Anthony avatar
    19 posts

    Posted 15 Aug 2011 Link to this post

    Hello Zabeer,

    Support for IE9 was not introduced until version 2010.3, so your scenario is not expected to work in version 2010.2.

    What version of Firefox are you using? Firefox 4 is not compatible with our 2010 version. If you are using FF 3.x, try changing your code to use actual mouse clicks, like this:

    Find.ById<HtmlInputControl>("uploadbutton").MouseClick(MouseClickType.LeftClick);

    Also, ActiveBrowser.WaitUntilReady(); should go after the actual upload. This ensures the upload is done and the browser is in a ready state before continuing the test.

    Greetings,
    Anthony
    the Telerik team
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
Back to Top