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

Problem in Execution of Silverlight Tests

1 Answer 58 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nitin
Top achievements
Rank 1
Nitin asked on 05 Jan 2012, 06:29 AM
Hi
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.
  Source=ArtOfTest.WebAii
  StackTrace:
       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
  InnerException:

How to Handle this kinf of Exception

1 Answer, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 05 Jan 2012, 04:20 PM
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:
http://screencast.com/t/Nz5zDCUtMHC .

Let me know if you need further assistance on this.   

Kind regards,
Plamen
the Telerik team

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