Hi,
I am quite new to Telerik and I am trying to set up automated tests for our WPF application. Whenever I try to use 'bar.User.TypeText("SomeText", 200)' to a framework element (found using 'FrameworkElement bar= foo.MainWindow.Find.ByAutomationId("New_Proj_Text_Box");') it sends a couple of letters to the TextBox, but then it cuts stops sending text.
I think that this may be something to do with the window loading as the TextBox is in a Modal window and when you open the modal window mmanually (rather than using the link via Telerik) SendText sends all the text to to the TextBox.
I have tried to introduce an "ensureClickable", changed the times for the "keyPressTime" and changing the clickFirst argument (trying both True and False). Unfortunately none of these seem to work.
I have placed my test below. Unfortunately there are no helpful errors in the logs.
Any help on this would be hugely appreciated.
Many thanks in advance,
David
using ArtOfTest.WebAii.Controls.Xaml.Wpf;
using ArtOfTest.WebAii.Core;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.TestTemplates;
using ArtOfTest.WebAii.Wpf;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace UnitTestProject2
{
/// <summary>
/// Summary description for TelerikNUnitTest1
/// </summary>
[TestClass]
public class TelerikNUnitTest1 : BaseWpfTest
{
private TestContext testContextInstance;
public WpfApplication foo { get; private set; }
/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
[TestMethod]
public void Open_Application()
{
Settings mySettings = new Settings();
mySettings.ClientReadyTimeout = 60000;
/// Use my Settings object to construct my Manager object
Manager myManager = new Manager(mySettings);
myManager.Start();
// Launch the application instance from its location in file system
WpfApplication fubar = myManager.LaunchNewApplication(@"C:\Users\e-ddcr\Documents\appLocation\Fubar.Startup.exe");
/// Validate the title of the homepage
ArtOfTest.Common.UnitTesting.Assert.IsTrue(fubar.MainWindow.Window.Caption.Equals("MainWindow"));
//TestContext.WriteLine("Validated window");
///Click the new project button
FrameworkElement newProjButton = fubar.MainWindow.Find.ByTextContent("New project...");
newProjButton.User.Click();
///Send keys to the project name textbox
FrameworkElement projNameTextBox = fubar.MainWindow.Find.ByAutomationId("New_Proj_Text_Box");
projNameTextBox.EnsureClickable();
projNameTextBox.User.Click();
projNameTextBox.User.TypeText("PokeMoon", 100);
}
}
}