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

DownloadDialogsHandler broken in Firefox 29.0

2 Answers 25 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Luca
Top achievements
Rank 1
Luca asked on 29 Apr 2014, 03:24 PM
Run this piece of code: 

[TestFixture]
  public class TelerikTestingFrameworkTests
  {
      [Test]
      public void DownloadAFile()
      {
          var mySettings = new Settings
          {
              Web =
              {
                  DefaultBrowser = BrowserType.FireFox
              },
              ExecutionDelay = 1,
              UnexpectedDialogAction = UnexpectedDialogAction.DoNotHandle
          };
 
          var manager = new Manager(mySettings);
          manager.Start();
          manager.LaunchNewBrowser();
          manager.DialogMonitor.Start();
 
          var browser = manager.ActiveBrowser;
 
          string urlForDownload = @"http://notepad-plus-plus.org/download/v6.5.5.html";
          browser.NavigateTo(urlForDownload);
           
          HtmlAnchor a = browser.Find.ByExpression<HtmlAnchor>("TextContent=Notepad++ Installer""tagname=a");
           
          string saveLocation = System.IO.Path.Combine(@"c:\", "notepadSetup.exe");
          File.Delete(saveLocation);
 
          DownloadDialogsHandler handler = new DownloadDialogsHandler(browser, DialogButton.SAVE, saveLocation, browser.Desktop);
          a.Click();
   
          handler.WaitUntilHandled(20000);
          //System.Threading.Thread.Sleep(10000);
           
          File.Exists(saveLocation).Should().BeTrue();
 
          manager.Dispose();
          File.Delete(saveLocation);
 
      }
  }

The result is:
System.TimeoutException : Timed out waiting '20000' msec. for any dialog to be handled '1'

The file is downloaded, but WaitUntilHandled fails everytime.
If I try to remove call to WaitUntilHandled and call Sleep(20000), all goes fine. 
 
I configured Firefox as described in http://docs.telerik.com/teststudio/user-guide/configure-your-browser/firefox.aspx
but  in Firefox 29 was removed the "Show the Downloads window.. " setting.

What is wrong in my code?









2 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 01 May 2014, 06:20 AM
Hello Luca,

I am sorry to hear you are experiencing this behavior. However using the latest version of Test Studio and Firefox 29 I was not able to reproduce this behavior. Could you please try upgrading and see if you are still able to reproduce the behavior.

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Ivaylo
Telerik team
answered on 01 May 2014, 06:56 AM
Hello Luca,

We were able to reproduce this behavior and logged a bug on your behalf which you can see using this public URL.
Until this is fixed please use the workaround that you have already found out with the Thread.Sleep.

Thank you for your understanding.

I have updated your telerik points accordingly for reporting this issue.

Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Luca
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Share this question
or