Telerik Forums
Testing Framework Forum
2 answers
77 views
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?









Ivaylo
Telerik team
 answered on 01 May 2014
6 answers
365 views
Hi Team,

We are creating generic functions for Upload dialog box which is displayed to the user when he clicks the button e.g. Browse
  There are two problems which we are facing.

1. The button is of HTMLinputfile type and we are unable to click it, using below code.
     // myManager.ActiveBrowser.Frames[0].Find.ById<HtmlInputFile>(objID).Click();

2. Once the browse button is clicked manually the windows open dialog box is displayed.
We have kept the code in Debug mode (visual studio  c#) and Telerik app closes closes the dialog box automatically.
Again if we click the browse button the windows open dialog box is displayed, and once we start our debugging we are able to upload files successfully using the below code.
=============
            try
            {
                FileUploadDialog fileDialog = new FileUploadDialog(Manager.Current.ActiveBrowser, InputFile, DialogButton.OPEN, objID);
                Manager.Current.DialogMonitor.AddDialog(fileDialog);
                Manager.Current.DialogMonitor.Start();

                // Wait Until Dialog is Handled.
                fileDialog.WaitUntilHandled(50000);
                Manager.Current.DialogMonitor.Stop();
.............................................

Inputfile="test.jpg",
objid = Object ID or the windows dialog box header

FYI: This works fine with record and playback.

Regards
Tapan
Cody
Telerik team
 answered on 28 Apr 2014
5 answers
130 views
Hello

I'm trying to select a cell on a third party DataGrid (ComponentOne FlexGrid) and I'm having some issues.

I cant seem to cast it as a Generic DataGrid and when I use CastAs<DataGrid> the rows and columns are coming back as 0.

I can see the children and they are there but I need to know how many columns there are to work out what item to select when they specify row and column.

I guess I could possibly add a property called columnCount to the control and then get it with GetProperty(). But I don't want to do that.

Is there a clean way I can get this info out ? In general if I have a collection can I use GetProperty or something similar to get its properties or its elements.

Thanks
Cody
Telerik team
 answered on 24 Apr 2014
2 answers
119 views
Hi,

Is there a repository of old Test Framework downloads?

I am specifically looking to download version 2013.2.1417.

I have scripts that will not run with the latest framework.

Thanks
Ghi
Top achievements
Rank 1
 answered on 17 Apr 2014
1 answer
105 views
I have several Firefox installed in my PC.
I am using Sandboxie to start Firefox, like this:

"C:\Program Files\Sandboxie\Start.exe" "d:\FirefoxTest_1\firefox.exe"

"C:\Program Files\Sandboxie\Start.exe" "d:\FirefoxTest_2\firefox.exe"

 
My test code is something like this:


// Launch an instance of the browser
Manager.LaunchNewBrowser(BrowserType.FireFox);

            
// Navigate to : 'http://localhost:12345/Default.aspx'
ActiveBrowser.NavigateTo("http://localhost:12345/Default.aspx", true);



Thanks.

 

Cody
Telerik team
 answered on 17 Apr 2014
1 answer
107 views
Hello

I'm having an issue where the ComboBoxItems are not being recognized in Silverlight. I am using a standard ComboBox with the attached style.

Other Combo Boxes seem to work find but this one uses a Control template with some additional features. When I view it in SilverlightSpy I can see the items fine (see attached).

My code
            var combo = _silverlightApp.Find.ByName<ComboBox>("cbFacilityTypes");
            //Items = null

I have tired 
            combo.Find.ByType<ComboBoxItem>();
            combo.Find.ByType<TextBox>();
            combo.IsDropDownOpen = true;            
            combo.Refresh();
            combo.ItemsPopup.Refresh();
           //looping through children the ScrollContentPresenter is always empty.
           //in the screen I can see it expanding the right combo but it just cant find any of the child controls but I can see them in SilverlightSpy

Any help much appreciated
Thanks







Konstantin Petkov
Telerik team
 answered on 17 Apr 2014
2 answers
159 views
Hello

I'm having an issue where the ComboBoxItems are not being recognized in Silverlight. I am using a standard ComboBox with the attached style.

Other Combo Boxes seem to work find but this one uses a Control template with some additional features. When I view it in SilverlightSpy I can see the items fine (see attached).

My code
            var combo = _silverlightApp.Find.ByName<ComboBox>("cbFacilityTypes");
            //Items = null

I have tired 
            combo.Find.ByType<ComboBoxItem>();
            combo.Find.ByType<TextBox>();
            combo.IsDropDownOpen = true;            
            combo.Refresh();
            combo.ItemsPopup.Refresh();
           //looping through children the ScrollContentPresenter is always empty.
           //in the screen I can see it expanding the right combo but it just cant find any of the child controls but I can see them in SilverlightSpy

Any help much appreciated
Thanks







Konstantin Petkov
Telerik team
 answered on 17 Apr 2014
2 answers
119 views
Hi

While (true)
{
    using (Manager manager = new Manager(false)
    {
        manager.Start();
        manager.LaunchNewBrowser(BrowserType.Chrome, true);
        manager.ActiveBrowser.WaitUntilReady();
        Console.WriteLine(manager.ActiveBrowser.Window.Exists);
        manager.ActiveBrowser.Close();
    }
}

Chrome browser.Window.Exists == null when starting for the second or third time.

This does not repro with IE nor with FF.
uteotw
Top achievements
Rank 1
 answered on 17 Apr 2014
1 answer
149 views
Hello forum users,

  I have a problem, to find a button via id on my page. The button has the id "test" and is surrounded by a section with the id "testform".

If I try to find my button with
 
HtmlInputSubmit myButton = Find.ById<HtmlInputSubmit> ("test");

I get null.
If I try
 
Element myButton = Find.ById ("test");

I get the surrounding section instead of the button. Very annoying.

It seems, that the Find.ById makes no exact search, but searches with contains, so that the first element, that contains my search text is found. It makes no different, if my form id is "testform" or "formtest"

My Form:
<section id="testform">
   
<h2>Headline</h2>
    @using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }))

    {

        <
input type="submit" class="k-button" value="Click me" id="test" />
    }

</
section>

PS: I'm using MVC 4.0 with razor syntax and .NET 4.0, VS 2010 Professional SP1, Telerik Testing Framework 2013.2

Greetings
  Thomas
Ivaylo
Telerik team
 answered on 16 Apr 2014
3 answers
343 views
Hello,

With the SHDocVw.InternetExplorer class you can do things like InternetExplorer.Document.Forms.FormName.Submit() and have a form submit without an actual submit button.

How can I replicate this behavior with the Testing Framework?

I can grab the form into an HTMLForm variable, but cannot figure out how to submit it.

For example:

<FORM style="POSITION: absolute; DISPLAY: none" id=frmRootDocument method=post action=controller.aspx target=appContentFrame>

The site is not public, so that's the best I can do.

Thanks.
Boyan Boev
Telerik team
 answered on 11 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?