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

Timeout trying to connect to Silverlight App.

3 Answers 197 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Artem
Top achievements
Rank 1
Artem asked on 11 May 2011, 01:56 PM
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'.
InnerException:
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>
            ///<br>
            /// </summary><br>
            public SilverlightAppElement SilverlightApp<br>
            {<br>
                get<br>
                {<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>
                }<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

3 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 16 May 2011, 11:15 AM
Hello Artem,
    it's possible that your Silverlight application isn't properly configured for test automation. We have KB article on this:
http://www.telerik.com/automated-testing-tools/support/kb/unable-to-connect-to-silverlight-application.aspx
Please implement the solutions suggested there.

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

Kind regards,
Stoich
the Telerik team

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

0
Abraham
Top achievements
Rank 1
answered on 03 Nov 2011, 09:10 PM
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.
0
Stoich
Telerik team
answered on 04 Nov 2011, 02:19 PM
Hi Abraham,
       check out this tutorial:
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/write-tests-in-code/silverlight-test-automation/introduction.aspx

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,
Stoich
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
Artem
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Abraham
Top achievements
Rank 1
Share this question
or