Ejemplo n.º 1
0
        public void WebElementExplorer_Test()
        {
            Helper.RunDefaultBrowser();
            Helper.LoadTestFile("page_with_frames.html");

            Helper.ToFrame(secondFrame);

            WebSpyBrowser.InjectVisualSearch();

            //Helper.ClickId();

            throw new NotImplementedException();
        }
Ejemplo n.º 2
0
        public void VisualSearch_UpdateSearchResult()
        {
            try
            {
                MyLog.Write("VisualSearch_UpdateSearchResult: Started");
                while (webElementExplorerStarted == true)
                {
                    if (!webElementExplorerThreadPaused)
                    {
                        try
                        {
                            if (!WebSpyBrowser.IsVisualSearchScriptInjected())
                            {
                                MyLog.Write("VisualSearch_UpdateSearchResult: Found the Visual search is not injected. Injecting");
                                WebSpyBrowser.InjectVisualSearch();
                            }

                            if (!webElementExplorerThreadPaused)
                            {
                                ProcessCommands();
                            }
                        }
                        catch (Exception e)
                        {
                            StopVisualSearch();
                            MyLog.Error("Visual search stopped:");
                            MyLog.Exception(e);
                        }
                    }
                    Thread.Sleep(VisualSearchQueryDelayMs);
                }
            }
            finally
            {
                StopVisualSearch();
                MyLog.Write("VisualSearch_UpdateSearchResult: Finished");
            }
        }
Ejemplo n.º 3
0
        internal void StartVisualSearch()
        {
            WebSpyBrowser.InjectVisualSearch();
            if (visualSearchWorker != null)
            {
                visualSearchWorker.Abort();
                visualSearchWorker = null;
            }

            webElementExplorerStarted = true;

            visualSearchWorker = new Thread(VisualSearch_UpdateSearchResult);
            visualSearchWorker.IsBackground = true;
            visualSearchWorker.Start();

            while (!visualSearchWorker.IsAlive)
            {
                Application.DoEvents();
                System.Threading.Thread.Sleep(1);
            }

            view.VisuaSearchStarted();
        }