Problem in Execution of Silverlight Tests

2 posts, 1 answers
  1. Nitin
    Nitin avatar
    29 posts
    Member since:
    Oct 2010

    Posted 05 Jan 2012 Link to this post

    I am facing one Problem in Executing Silverlight Tests using Telerik Framework
    My Application Launches with Username and Password
    When i click on Login Button , Silverlight Application Opens

    I Created Orderd Test and Running Two Methods 

    public void Login()

    public void NavigateToTransfer()

    But My Test Method Fails and Throws Exception

    System.NullReferenceException was unhandled by user code
      Message=Object reference not set to an instance of an object.
           at ArtOfTest.WebAii.Silverlight.SilverlightAppFinder.SilverlightApps(Browser browser)
           at SilverlightAutomation.SilverlightUnitTests.NavigateToTransfer() in C:\Users\nitinahu\documents\visual studio 2010\Projects\SilverlightAutomation\SilverlightAutomation\SilverlightUnitTests.cs:line 196

    How to Handle this kinf of Exception
  2. Answer
    Plamen avatar
    8 posts

    Posted 05 Jan 2012 Link to this post

    Hello Nitin,

    When you are executing more than one test methods and there is a connection between the tests, you need to set the RecycleBrowser property to True. In your case (I believe this is an MSTest) you need to expand the WebAii Initialization region and find the following line:
    // Pass in 'true' to recycle the browser between test methods
    Initialize(false, this.TestContext.TestLogsDir, new TestContextWriteLine(this.TestContext.WriteLine));
    Change the value of the first argument to true and the second test will start right after the first, against the same browser.

    Check out this video for more information: .

    Let me know if you need further assistance on this.   

    Kind regards,
    the Telerik team

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