예제 #1
0
        private void Record()
        {
            string      url  = @"http://www.baidu.com/";
            TestSession test = new HTMLTestSession();

            test.Browser.Start();
            test.Browser.Load(url, true);
            test.Event.OnClick += new TestObjectEventHandler(Recorder_OnClick);

            //app = new MSAATestApp();
            //app.Find(null, "SciCalc");
            //dispatcher = (MSAAEventDispatcher)app.GetEventDispatcher();
            //dispatcher.OnClick += new TestObjectEventHandler(Recorder_OnClick);
        }
예제 #2
0
        private void HandleMouseMovements()
        {
            if (!_capturing)
            {
                return;
            }

            try
            {
                Point p = MouseOp.GetMousePos();

                if (_html == null)
                {
                    _html = new HTMLTestPlugin();
                    _ts   = _html.CreateTestSession() as HTMLTestSession;
                }

                IntPtr curHandle = Win32API.WindowFromPoint(p.X, p.Y);
                if (curHandle != _lastHandle)
                {
                    _lastHandle  = curHandle;
                    _isSupported = _html.IsSupportedApp(curHandle);
                    if (_isSupported)
                    {
                        _ts.Browser.Find(curHandle);
                        //_ts.Event.OnMouseOver += new TestObjectEventHandler(Event_OnMouseOver);
                    }
                }

                if (_isSupported)
                {
                    TestObject obj = _ts.Objects.ObjectPool.GetObjectByPoint(p.X, p.Y, true);

                    if (!obj.Equals(_lastObj))
                    {
                        Thread t = new Thread(new ParameterizedThreadStart(SetText));
                        t.Start(obj);
                        _lastObj = obj;
                    }
                    else
                    {
                        IVisible v = obj as IVisible;
                        v.HighLight();
                    }
                }
            }
            catch
            {
            }
        }
예제 #3
0
        private void HandleMouseMovements()
        {
            if (!_capturing)
                return;

            try
            {
                Point p = MouseOp.GetMousePos();

                if (_html == null)
                {
                    _html = new HTMLTestPlugin();
                    _ts = _html.CreateTestSession() as HTMLTestSession;
                }

                IntPtr curHandle = Win32API.WindowFromPoint(p.X, p.Y);
                if (curHandle != _lastHandle)
                {
                    _lastHandle = curHandle;
                    _isSupported = _html.IsSupportedApp(curHandle);
                    if (_isSupported)
                    {
                        _ts.Browser.Find(curHandle);
                        //_ts.Event.OnMouseOver += new TestObjectEventHandler(Event_OnMouseOver);
                    }
                }

                if (_isSupported)
                {
                    TestObject obj = _ts.Objects.ObjectPool.GetObjectByPoint(p.X, p.Y, true);

                    if (!obj.Equals(_lastObj))
                    {
                        Thread t = new Thread(new ParameterizedThreadStart(SetText));
                        t.Start(obj);
                        _lastObj = obj;
                    }
                    else
                    {
                        IVisible v = obj as IVisible;
                        v.HighLight();
                    }
                }
            }
            catch
            {
            }
        }
예제 #4
0
        private void Record()
        {
            string url = @"http://www.baidu.com/";
            TestSession test = new HTMLTestSession();
            test.Browser.Start();
            test.Browser.Load(url, true);
            test.Event.OnClick += new TestObjectEventHandler(Recorder_OnClick);

            //app = new MSAATestApp();
            //app.Find(null, "SciCalc");
            //dispatcher = (MSAAEventDispatcher)app.GetEventDispatcher();
            //dispatcher.OnClick += new TestObjectEventHandler(Recorder_OnClick);
        }