예제 #1
0
파일: WaveformSteps.cs 프로젝트: undees/esc
 public void AWaveform()
 {
     var launcher = new ApplicationLauncher();
     app = launcher.Recycle("WaveformApp");
     win = app.FindWindow("Waveform");
 }
예제 #2
0
        public void run_application()
        {
            var waitForApplicationStart = new ManualResetEvent(false);

            _thread = new Thread(() =>
                                     {
                                         _app = new System.Windows.Application();
                                         _app.Startup += (s, e) =>
                                                             {
                                                                 waitForApplicationStart.Set();
                                                                 _app.MainWindow = new Window();
                                                                 _app.MainWindow.ShowDialog();
                                                             };
                                         _app.Run();
                                     });
            _thread.IsBackground = true;
            _thread.SetApartmentState(ApartmentState.STA);
            _thread.Name = "Application under testing";
            _thread.Start();
            waitForApplicationStart.WaitOne();

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

            _process = Process.GetCurrentProcess();
            _application = new Application(_process);
            _windowAutomation = _application.FindWindow("MainWindow");
              //  Thread.Sleep(TimeSpan.FromSeconds(20));
        }