Timeout trying to connect to Silverlight App.

4 posts, 0 answers
  1. Artem
    Artem avatar
    25 posts
    Member since:
    Jul 2010

    Posted 11 May 2011 Link to this post

    I have small test silverlight application and trying to create automated tests for it.
    But the following error occurs

    Exception thrown executing coded step: '[WebTest1_CodedStep] : @"New Coded Step'.
    System.TimeoutException: Timeout trying to connect to Silverlight App.
       at ArtOfTest.WebAii.Silverlight.SilverlightApp.WaitUntilExtensionCreated(String extensionCall)
       at ArtOfTest.WebAii.Silverlight.SilverlightApp.Connect(Int32 timeout)
       at ArtOfTest.WebAii.Silverlight.SilverlightApp.Connect()
       at ArtOfTest.WebAii.Silverlight.SilverlightAppsList.get_Item(Int32 index)
       at TEstVAM.Pages.SilverlightApplicationPage.get_SilverlightApp() in C:\NeA\TEstVAM\TEstVAM\Pages.g.cs:line 123
       at TEstVAM.WebTest1.WebTest1_CodedStep() in C:\NeA\TEstVAM\TEstVAM\WebTest1.tstest.cs:line 77

    in the string

    return new SilverlightAppElement(plugin.OwnerBrowser.SilverlightApps()[appIndex].Find);

    in the

    /// <summary><br>
                /// Find logic <br>
                /// (Html): [id 'Exact' silverlightControlHost] AND [tagname 'Exact' div][type 'Exact' application/x-silverlight-2]<br>
                /// </summary><br>
                public SilverlightAppElement SilverlightApp<br>
                        ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl plugin = Get<ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl>("tagname=div", "id=silverlightControlHost", "|", "type=application/x-silverlight-2");<br>
                        int appIndex = plugin.OwnerBrowser.GetSilverlightAppIndex(plugin);<br>
                        return new SilverlightAppElement(plugin.OwnerBrowser.SilverlightApps()[appIndex].Find);<br>

    In the Pages.g.cs file

    As I could see from debug plugin.OwnerBrowser.SilverlightApps() has one element and appIndex is equal to 0

    Application is located on the localhost, but the same error occurs when application is located on the remote server.

    I'm Using VS2010 and Test Studio Express  2011.1.502.0
  2. Stoich
    Stoich avatar
    1 posts

    Posted 16 May 2011 Link to this post

    Hello Artem,
        it's possible that your Silverlight application isn't properly configured for test automation. We have KB article on this:
    Please implement the solutions suggested there.

    Let me know if you're still unable to get this to work.

    Kind regards,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  3. Abraham
    Abraham avatar
    1 posts
    Member since:
    May 2011

    Posted 03 Nov 2011 Link to this post

    Hi Stoich,

    I'm having a similar problem, and the offered solutions didn't seem to fit the bill...
    Preface: I have a trial version, and am evaluating it's use to incude in our TDD culture.
    An important consideration is going to be the integration with the built-in VS (2010) Test.

    I can record, run, and pass tests that are .tstest files using the VS Test Menu (Run All Tests, or Test in Current Context both work fine), so this integration is exactly what we need.

    However, when I take that same test, and convert it to a Code Test, I get the same error when the test runs.
    Note The built-in google code test also fails trying to locate the submit button.
  4. Stoich
    Stoich avatar
    1 posts

    Posted 04 Nov 2011 Link to this post

    Hi Abraham,
           check out this tutorial:

    You're probably missing the following line of code:
    Settings.Current.Web.EnableSilverlight = true;

    Try adding this line of code to the beginning of your test. Does the issue persist?

    @Note The built-in google code test also fails trying to locate the submit button. - you're probably using an older version of our product. Google implemented a lot of changes in the Search pages. Because of this the built-in test has become invalid. The latest release of the Telerik Testing Framework feature an update version of the built-in test which should run successfully.

    All the best,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top