Esempio n. 1
0
        static void Main(string[] args)
        {
            try
            {
                _application = White.Core.Application.Attach(Process.GetProcessesByName("iSystems 3.0")[0].Id);
                _mainWindow  = _application.GetWindow(SearchCriteria.ByText("iSystem Panel"), InitializeOption.NoCache);
                List <White.Core.UIItems.UIItem>    itm = new List <White.Core.UIItems.UIItem>();
                White.Core.UIItems.UIItemCollection xxx = _mainWindow.Items;

                foreach (White.Core.UIItems.UIItem i in xxx)
                {
                    if (i.ToString().StartsWith("Panel"))
                    {
                        foreach (White.Core.UIItems.UIItem Ucol in ((White.Core.UIItems.Panel)i).Items)
                        {
                            itm.Add(Ucol);
                        }
                    }
                    else if (i.ToString().StartsWith("GroupBox"))
                    {
                        foreach (White.Core.UIItems.UIItem Ucol in ((White.Core.UIItems.GroupBox)i).Items)
                        {
                            itm.Add(Ucol);
                        }
                    }
                }


                string s = ((White.Core.UIItems.ListBoxItems.Win32ComboBox)_mainWindow.Items[6]).SelectedItemText;
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Esempio n. 2
0
        private static void EnsureApplicationIsRunning()
        {
            if (_application != null)
            {
                return;
            }

            _thread = new Thread(RunApplication);
            _thread.SetApartmentState(ApartmentState.STA);
            _thread.Name = "Gui test runner thread";

            var synchronization = new AutoResetEvent(false);

            _thread.Start(synchronization);
            synchronization.WaitOne();
            synchronization.Close();

            _whiteApplication = WhiteApplication.Attach(Process.GetCurrentProcess());
        }
Esempio n. 3
0
        public void run_application()
        {
            var waitForApplicationStart = new ManualResetEvent(false);

            var thread = new Thread(() =>
            {
                _app          = new App();
                _app.Startup += (s, e) =>
                {
                    waitForApplicationStart.Set();
                };
                _app.Run();
            });

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            waitForApplicationStart.WaitOne();

            _dispatcher = Dispatcher.FromThread(thread);
            _dispatcher.Invoke(new ThreadStart(() => _window = _app.MainWindow as TestApp.Window));

            _whiteApp         = Application.Attach(Process.GetCurrentProcess());
            _windowAutomation = _whiteApp.GetWindow("MainWindow");
        }
Esempio n. 4
0
        public void run_application()
        {
            var waitForApplicationStart = new ManualResetEvent(false);

            var thread = new Thread(() =>
                                        {
                                            _app = new App();
                                            _app.Startup += (s, e) =>
                                                                {
                                                                    waitForApplicationStart.Set();
                                                                };
                                            _app.Run();
                                        });

            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
            waitForApplicationStart.WaitOne();

            _dispatcher = Dispatcher.FromThread(thread);
            _dispatcher.Invoke(new ThreadStart(() => _window = _app.MainWindow as TestApp.Window));

            _whiteApp = Application.Attach(Process.GetCurrentProcess());
            _windowAutomation = _whiteApp.GetWindow("MainWindow");
        }
Esempio n. 5
0
        private static void EnsureApplicationIsRunning()
        {
            if (_application != null)
                return;

            _thread = new Thread(RunApplication);
            _thread.SetApartmentState(ApartmentState.STA);
            _thread.Name = "Gui test runner thread";

            var synchronization = new AutoResetEvent(false);
            _thread.Start(synchronization);
            synchronization.WaitOne();
            synchronization.Close();

            _whiteApplication = WhiteApplication.Attach(Process.GetCurrentProcess());
        }