using System; /*using System.Collections.Generic; using System.Linq; using System.Text;*/ using White.Core; using White.Core.UIItems; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { int ProcessID = Convert.ToInt16(args[0]); string WindowName = args[1]; string ButtonName = args[2]; Console.WriteLine("Arguments---------------"); Console.WriteLine("ProcessID: " + ProcessID); Console.WriteLine("WindowName: " + WindowName); Console.WriteLine("ButtonName: " + ButtonName); Console.WriteLine("---------------"); White.Core.Configuration.CoreAppXmlConfiguration.Instance.RawElementBasedSearch = true; White.Core.Configuration.CoreAppXmlConfiguration.Instance.MaxElementSearchDepth = 50; White.Core.Application application = White.Core.Application.Attach(ProcessID); White.Core.UIItems.WindowItems.Window window = application.GetWindow(WindowName); //White.Core.UIItems.Custom.CustomUIItem button = window.Get====================================("Styles"); White.Core.UIItems.Button button = window.Get (ButtonName); button.Click(); window.LogStructure(); /* White.Core.UIItems.UIItemCollection uitcol = window.Items; foreach (UIItem itm in uitcol) { Console.WriteLine("------------------------------------------------------"); Console.WriteLine("AutomationId: " + itm.Id); Console.WriteLine("name: " + itm.Name); Console.WriteLine("Labe By: " + itm.AutomationElement.Current.LabeledBy); Console.WriteLine("Class Name: " + itm.AutomationElement.Current.ClassName); Console.WriteLine("to String: " + itm.ToString()); } //---------------------------------------------------------------------- //Text Box Example======================================================= //White.Core.UIItems.TextBox TextB = window.Get ("Number Format"); //Console.WriteLine(TextB.Text); //TextB.Text = "Currency"; //Console.WriteLine(TextB.Text); //---------------------------------------------------------------------- */ Console.WriteLine("Hit Enter to Exit!!!!!!!!!!!!!!"); Console.ReadLine(); } } }
cd c:\Windows\Microsoft.NET\Framework\v2.0.50727
csc /reference:c:\temp1\alltext\White.Core.dll /reference:C:\temp1\alltext\Bricks.dll /target:exe /out:c:\temp1\alltext\click.exe c:\temp1\alltext\click.cs
Click.exe 4024 "Microsoft Excel - Book1" "Bold"
====================================