Hello!
I wrote simple test for silverlight sample app http://www.artoftest.com/Samples/SampleApplication.html
The code is:
Manager.LaunchNewBrowser();
Manager.ActiveBrowser.NavigateTo("http://www.artoftest.com/Samples/SampleApplication.html");
Manager.ActiveBrowser.WaitUntilReady();
System.Threading.Thread.Sleep(1000);
SilverlightApp app = Manager.ActiveBrowser.SilverlightApps()[0];
Assert.IsNotNull(app);
TextBox name = app.Find.ByName<TextBox>("name1");
name.User.TypeText("john", 50);
Button okButton = app.Find.ByName<Button>("okButton");
okButton.User.Click();
FrameworkElement message = app.Find.ByName("message1");
Assert.IsTrue(message.TextContent.Contains("Selected Date: <date not selected>"));
After I run the test, the assertion is failed, what is wrong in my assertion?
Also, if I set assertion Assert.IsTrue(message.TextContent.Contains("Hi john Selected Date: <date not selected>"));
it is failed, too.
How should I write the assertion to check that all this phrase ("Hi john Selected Date: <date not selected>") is displayed in the framework element?
I wrote simple test for silverlight sample app http://www.artoftest.com/Samples/SampleApplication.html
The code is:
Manager.LaunchNewBrowser();
Manager.ActiveBrowser.NavigateTo("http://www.artoftest.com/Samples/SampleApplication.html");
Manager.ActiveBrowser.WaitUntilReady();
System.Threading.Thread.Sleep(1000);
SilverlightApp app = Manager.ActiveBrowser.SilverlightApps()[0];
Assert.IsNotNull(app);
TextBox name = app.Find.ByName<TextBox>("name1");
name.User.TypeText("john", 50);
Button okButton = app.Find.ByName<Button>("okButton");
okButton.User.Click();
FrameworkElement message = app.Find.ByName("message1");
Assert.IsTrue(message.TextContent.Contains("Selected Date: <date not selected>"));
After I run the test, the assertion is failed, what is wrong in my assertion?
Also, if I set assertion Assert.IsTrue(message.TextContent.Contains("Hi john Selected Date: <date not selected>"));
it is failed, too.
How should I write the assertion to check that all this phrase ("Hi john Selected Date: <date not selected>") is displayed in the framework element?