or
var radColorPicker = app.MainWindow.Find.AllByType<RadColorPicker>();radColorPicker[0].SelectItem(0, 1);Manager manager = new Manager(false);manager.Start(); WpfApplication wpfApplication = manager.LaunchNewApplication(@"Wpf.Application1.exe");WpfWindow wpfWindow = wpfApplication.GetWindow("MainWindow");wpfWindow.Find.ByName<Button>("button2").User.Click(); //The new WPF window is shown, how can I attach to it?//Service that actively monitors a spesific HTML DOM Object for changes//IF the HTMLControl is found the object monitored, a true is setnamespace Newton2_Automation.SharedFunctionLib{ public class MonitorHtmlObject { public MonitorHtmlObject(HtmlControl monitorControl, string htmlId = null, string htmlClass = null) { _monitorControl = monitorControl; _htmlId = htmlId; _htmlClass = htmlClass; } public void Start() { oThread = new Thread(new ThreadStart(HTMLRunner)); oThread.Start(); while (!oThread.IsAlive) ; } public bool Output; public void Stop() { oThread.Abort(); } private void HTMLRunner() { Output = false; while (true) { try { if ((monitorControl.Find.ByAttributes(_htmlId)) != null) { Output = true; } } catch { continue; } _monitorControl.Refresh(); } } private Thread oThread; private HtmlControl _monitorControl; private HtmlControl monitorControl { get { while (_monitorControl.IsRefresh == true) { Thread.Sleep(100); } return _monitorControl; } } private string _htmlId; private string _htmlClass; }}foreach (HtmlDiv col in getPlaceHolders) { int ColCounbt = new int(); try { ColCounbt = col.Find.ByTagIndex("ul", 0).ChildNodes.Count; } catch { ColCounbt = 0; continue; } if (ColCounbt > 0) { HtmlListItem[] GagetColection = new HtmlListItem[col.Find.ByTagIndex("ul", 0).ChildNodes.Count]; for (int i = 0; i < GagetColection.Count(); i++) { GagetColection[i] = ((HtmlUnorderedList)(col.Find.ByTagIndex<HtmlUnorderedList>("ul", 0))).ChildNodes[i].As<HtmlListItem>(); } foreach (HtmlListItem item in GagetColection) { HtmlUnorderedList toCol = getPlaceHolders[sf.GenRandomNum(0, getPlaceHolders.Count())].Find.ById<HtmlUnorderedList>("undefinedGadgetHolder"); item.Refresh(); HtmlDiv GadgetHeader = item.Find.ByAttributes<HtmlDiv>("class=~gadget-head"); MonitorHtmlObject monitor = new MonitorHtmlObject(toCol, "class=gadget-placeholder"); monitor.Start(); GadgetHeader.DragTo(toCol, OffsetReference.AbsoluteCenter, Point.Empty); Log.WriteLine(monitor.Output.ToString()); monitor.Stop(); ActiveBrowser.WaitForAjax(10000); System.Threading.Thread.Sleep(5000); } } }