вторник, 10 июня 2014 г.

GetChildren

ApplicationUnderTest app; app = ApplicationUnderTest.Launch(@"c:\windows\system32\notepad.exe"); WinWindow w = UITestControlFactory.FromWindowHandle(app.WindowHandle) as WinWindow; foreach (var c in w.GetChildren()) { Console.WriteLine("Name: {0}, Caption: {1}, ControlType: {2}", c.Name, c.FriendlyName, c.ControlType); if (c.ControlType.ToString().Equals("Client")) { foreach (var c1 in c.GetChildren()) { Console.WriteLine("ClassName : {0}", c1.ClassName); if (c1.ClassName.Equals("Edit")) { WinEdit e1 = new WinEdit(c1); e1.Text = "Hello world " + DateTime.Now.ToString(); } } } } Console.WriteLine(new string('=', 75)); app.Process.CloseMainWindow();

https://apisamplecode.codeplex.com/SourceControl/latest#cuicode/cuicode.cs

Комментариев нет:

Отправить комментарий