Val
Val

Reputation: 639

UI test automation of Silverlight Navigation Applications

I am writing Silverlight UI test automation using this article as a guide: http://msmvps.com/blogs/theproblemsolver/archive/2009/01/26/unit-testing-in-silverlight-part-4-the-ui.aspx

It works for small Silverlight applications, but when I try to add to TestPanel a Silverlight Navigation Application, I get this exception: "Cannot find a Resource with the Name/Key LayoutRootGridStyle [Line: 10 Position: 37]". Here's the code:

[TestClass]
public class Tests : SilverlightTest
{
    private MainPage _myControl;

    [TestMethod]
    [Asynchronous]
    public void TestMethod1()
    {
        _myControl = new MainPage(); // <-- exception
        TestPanel.Children.Add(_myControl);
    }
}

Upvotes: 1

Views: 242

Answers (1)

JasonRShaver
JasonRShaver

Reputation: 4394

Is MainPage inherited from Page? If so, I think that TestPanel would need to define a Grid with the name "LayoutRoot".

Check out this link for another view of the same issue: http://silverlight.codeplex.com/workitem/8175

Upvotes: 1

Related Questions