I have a small test using Test Framework. Here's the sample code:
On following line:
I get the following error:
System.InvalidCastException : Unable to cast object of type 'ArtOfTest.WebAii.Wpf.WpfWindow' to type 'ArtOfTest.WebAii.Silverlight.SilverlightApp'.
at ArtOfTest.WebAii.Silverlight.UI.ComboBox.get_Items()
at ArtOfTest.WebAii.Silverlight.UI.ComboBox.RefreshItemsForSelection()
at ArtOfTest.WebAii.Silverlight.UI.ComboBox.SelectItemByText(Boolean simulateRealUser, String text)
at TelerikTestFramework.TelerikNUnitTest1.TestTextBox() in TelerikNUnitTest1.cs: line 135
What may be the problem?
The other question is about the maturity of Telerik Testing Framework for WPF. I only see two classes in Wpf namespace and all controls are returned from Silverlight namespace. Even though the framework looks great and clean, but I'm reluctant to recommend Telerik's framework if it's not prepared to test WPF apps.
Thanks
[Test]
public
void
TestTextBox()
{
WpfApplication wpfApp = Manager.LaunchNewApplication(@
"C:\Projects\myapp.exe"
);
var loginWindow = wpfApp.GetWindow(
"Login"
);
loginWindow.Find.ByName<TextBox>(
"usernameTextBox"
).Text =
"user1"
;
loginWindow.Find.ByName<PasswordBox>(
"passwordTextBox"
).Password =
"pass1"
;
loginWindow.Find.ByName<ComboBox>(
"environmentComboBox"
).SelectItemByText(
false
,
"DEV"
);
loginWindow.Find.ByName<Button>(
"connectButton"
).Click(MouseClickType.LeftClick,
false
,
false
, 0, 0, OffsetReference.AbsoluteCenter, ActionPointUnitType.Pixel);
}
On following line:
loginWindow.Find.ByName<ComboBox>(
"environmentComboBox"
)
I get the following error:
System.InvalidCastException : Unable to cast object of type 'ArtOfTest.WebAii.Wpf.WpfWindow' to type 'ArtOfTest.WebAii.Silverlight.SilverlightApp'.
at ArtOfTest.WebAii.Silverlight.UI.ComboBox.get_Items()
at ArtOfTest.WebAii.Silverlight.UI.ComboBox.RefreshItemsForSelection()
at ArtOfTest.WebAii.Silverlight.UI.ComboBox.SelectItemByText(Boolean simulateRealUser, String text)
at TelerikTestFramework.TelerikNUnitTest1.TestTextBox() in TelerikNUnitTest1.cs: line 135
What may be the problem?
The other question is about the maturity of Telerik Testing Framework for WPF. I only see two classes in Wpf namespace and all controls are returned from Silverlight namespace. Even though the framework looks great and clean, but I'm reluctant to recommend Telerik's framework if it's not prepared to test WPF apps.
Thanks