Hello!
I am new in WebAii and, to be honest, I am new in C# programming.
I try creating my own project or using a sampler (SilverlightHealthcareSample.cs). I have an error with message:
Test method QuickStarts_VSTS_CS.SilverlightHealthcareSample.HealthCareDemo threw exception: System.NullReferenceException: Object reference not set to an instance of an object..
at ArtOfTest.Common.TreeCrawler`3.SearchUsingNonHierarchialMatch(ITargetElement startNode, IList`1 clauses, V expression, Boolean ignoreConstraints)
at ArtOfTest.Common.TreeCrawler`3.Find(T startNode, IList`1 clauses, V expression, Boolean includeRoot, Boolean ignoreContraints)
at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression, Boolean includeRoot)
at ArtOfTest.Common.TreeCrawler`3.ByExpression(V expression)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByName(String name)
at ArtOfTest.WebAii.Silverlight.SilverlightApp.FindName(String name)
at QuickStarts_VSTS_CS.SilverlightHealthcareSample.HealthCareDemo() in C:\..\UnitTest1.cs:line 155
Error is occurred when I try to use any Find method.
My code (only interesting lines, actually it is all from the sampler):
[TestInitialize()]
public void MyTestInitialize()
{
Settings settings = GetSettings();
settings.EnableSilverlight = true;
Initialize(settings, new TestContextWriteLine(this.TestContext.WriteLine));
SetTestMethod(this, (string)TestContext.Properties["TestName"]);
}
[TestMethod]
[Description("Automate a complex Silverlight application")]
public void HealthCareDemo()
{
Manager.Settings.ExecutionDelay = 10;
Manager.LaunchNewBrowser(BrowserType.InternetExplorer);
System.Drawing.Point loc = ActiveBrowser.Window.Location;
ActiveBrowser.NavigateTo("http://www.mscui.net/PatientJourneyDemonstrator/PrimaryCareAdmin.htm");
ActiveBrowser.Window.Move(new System.Drawing.Rectangle(loc, new System.Drawing.Size(1024, 768)), true);
//SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
// I have an error on the line above, but with line below works fine
SilverlightApp app = ActiveBrowser.SilverlightApps().First();
app.FindName("guideButton").User.Click(); // <= I have the error there
}
Also I tried to use construction like this:
TextBox name1 = app.Find.ByName<TextBox>("name1");
FrameworkElement ss = app.Find.ByName("name1");
I have the same error.
I tried to run that code with the latest version of WebAii 2.0 from ArtOfTest site. After that I uninstalled WebAii and installed WebAii (Testing Framework 2010.1.412.FREE_EDITION) from Telerik site. But the error is still present.
Could you please give me an advice to solve the issue? May be something wrong with my environment?
MS Win XP Professional SP 3 English
Visual Studio 2008
IE 8.0.6001.18702
MS Silverlight 3.0.50106.0 (add-ons is enabled in IE)
WebAii Test Execution Extension 2.0.50727.3053 (add-ons is enabled in IE)
Thanks for your attention.