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

No Silverlight apps? ("index '0' is invalid. List contains ony '0' apps")

1 Answer 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Richard Grimmer
Top achievements
Rank 1
Richard Grimmer asked on 12 Oct 2010, 08:55 AM
Hi guys,
OK, so I've given up attempting to use the test recorder - it seems to be just too flaky for any costructive use, so I've gone back to manually coding up tests, and have run into yet another problem....

We have a standard asp.net web app using frames. In one frame we have a "Dashboard" and in another we have a menu - both of which are silverlight controls. There are also several "preceding" frames which just contain normal html. I'm able to drive the login portion of our app correctly and log in to the sysytem, but when using the following code, I'm consistently getting the error mentioned in the title:

            HtmlAnchor a = this.manager.ActiveBrowser.Find.ByContent<HtmlAnchor>("LoginLink");
            if (null != a)
            {
                a.Click();
            }
            this.manager.ActiveBrowser.WaitUntilReady();
            this.manager.ActiveBrowser.RefreshDomTree();

            // 0 in list...
            SilverlightApp app = this.manager.ActiveBrowser.SilverlightApps()[0];




Any ideas? I'm guessing that it's due to the additional frames - I've managed to get the following:

            
            Browser b = this.manager.ActiveBrowser.Frames["Menu"];

To work, but the returned Browser object seems not to be quite the same as a "normal" browser, and so still can't find any SL apps...

Anyone?

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 13 Oct 2010, 11:22 PM
Hi Richard Grimmer,

It is very common (but not always true) for the Silverlight app to be contained within a frame. If this is the case you need code like this to get the Silverlight app:

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

Greetings,
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
Tags
General Discussions
Asked by
Richard Grimmer
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or