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

Timeout error when creatng a SilverlightApps

4 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ray Lin
Top achievements
Rank 1
Ray Lin asked on 13 May 2010, 04:29 AM
I just use this tool today. My environment : Windows 7 and VSTS 2010.
I would like to use WebAii to test silverlight. But when I create the following silverlight application, it always shows the timeout error

 

 

SilverlightApp app = ActiveBrowser.SilverlightApps()[0];

 

In another thread, I find someone was asking this question, but there is no correct answer now.
I used the following ones, but no work luckily.

settings.EnableSilverlight=

 

true; : still has the timeout

 

 

 

Manager.Settings.ExecuteCommandTimeout = (200000); still has the timeout

 

 

 

 

Use fiddler-> Inspector-Header: No response data about application/x-silverlight-app

When I debug it, I find app[0].Count=1 (really has the data) , but I really don't know why it shows the timeout error.

Any idea to fix this issue?

Thank you,
Ray



4 Answers, 1 is accepted

Sort by
0
Missing User
answered on 13 May 2010, 11:07 PM
Hello Ray,

Thanks for posting what you've tried so far. Did the thread have a post with a Silverlight Connection Document attachment? If not, please see the attached document for more things you can check.

From the document, please check out the 'windowless' entry as another customer had similar problems and resolved this by setting the 'windowless' property to false.

Also, the response header must be there in order for the framework to detect a Silverlight app is being loaded, so please make sure that response is being sent by your server.

Greetings,
Nelson
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ray Lin
Top achievements
Rank 1
answered on 14 May 2010, 07:48 AM

      Hi, Thanks for your reply.

      Our team is trying to test silverlight apps now. I am doing some research. I write a simple test case and go to  one of the silverlight sites online. Could you please tell me where I can add Windowless =false?

       The following line still shows the timeout error.

      SilverlightApp app = ActiveBrowser.SilverlightApps()[0];


       public bool Windowless { get; set; }

        [TestMethod]
        public void VegaFinsElements()
        {
                 
            Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
            ActiveBrowser.ClearCache(BrowserCacheType.TempFilesCache);
            ActiveBrowser.NavigateTo("http://demo.componentone.com/Silverlight/ControlExplorer/");
            Settings settings = GetSettings();     
            settings.EnableSilverlight= true;
            Windowless = false;    
            Manager.Settings.ExecuteCommandTimeout = (100000);
            SilverlightApp app = ActiveBrowser.SilverlightApps()[0];         

        

        }

Thank you,

Ray

0
Accepted
Cody
Telerik team
answered on 14 May 2010, 04:48 PM
Hi Ray Lin,

First let me clarify, the Windowless =false setting only applies to the HTML code that is used to add the Silverlight application to your webpage like this:

Silverlight.createObject("ClientBin/SLDemo786.xap",
parentElement, pluginId,{
width: "400", height: "300",
background: "white",
IsWindowless: false, windowless: false,
alt: altHtml,
version: "3.0.40624.0", autoUpgrade: true},
{},"sData = 12358 ", userContext);


I think I see the real problem however. When programming in code, the EnableSilverlight=True setting needs to be set before starting the manager object. If you're using one of our test templates you will want to do this in the initialization block like this:

// Use TestInitialize to run code before running each test
[TestInitialize()]
public void MyTestInitialize()
{
    #region WebAii Initialization
    // Initializes WebAii manager to be used by the test case.
    // If a WebAii configuration section exists, settings will be
    // loaded from it. Otherwise, will create a default settings
    // object with system defaults.
    Settings settings = GetSettings();
    // Override the settings you want. For example:
    settings.EnableSilverlight = true;
    // Now call Initialize again with your updated settings object
    Initialize(settings, new TestContextWriteLine(this.TestContext.WriteLine));
    // Set the current test method. This is needed for WebAii to discover
    // its custom TestAttributes set on methods and classes.
    // This method should always exist in [TestInitialize()] method.
    SetTestMethod(this, (string)TestContext.Properties["TestName"]);
    #endregion
    //
    // Place any additional initialization here
    //
}

With that in place your test method is reduced to this:

[TestMethod] 
public void VegaFinsElements() 
    Manager.LaunchNewBrowser(BrowserType.InternetExplorer); 
    ActiveBrowser.ClearCache(BrowserCacheType.TempFilesCache); 
    ActiveBrowser.NavigateTo("http://demo.componentone.com/Silverlight/ControlExplorer/"); 
    SilverlightApp app = ActiveBrowser.SilverlightApps()[0];           
}

Let me know if I can be of further assistance.

Kind regards,
Cody
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ray Lin
Top achievements
Rank 1
answered on 14 May 2010, 05:59 PM
Hi, Cody
 Thanks for your great reply. It is workinfg for me now. :)

Ray
Tags
General Discussions
Asked by
Ray Lin
Top achievements
Rank 1
Answers by
Missing User
Ray Lin
Top achievements
Rank 1
Cody
Telerik team
Share this question
or