Completed
Last Updated: 17 Jun 2014 11:36 by ADMIN
ADMIN
Ivaylo
Created on: 01 May 2014 06:51
Type: Bug Report
3
Download dialog is not handled in code in Firefox 29
The following code does not handle download dialog and times out. The workaround is to use Thread.Sleep:

[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);
 
      }
  }
1 comment
ADMIN
Daniel Djambov
Posted on: 17 Jun 2014 11:35
Telerik: the issue is fixed and solution will be available in our next product release planned in the beginning of June 2014.