public void SimulateRealTyping(string valueToBeTyped)
 {
     HtmlControl.Focus();
     HtmlControl.MouseClick();
     Manager.Current.Desktop.KeyBoard.TypeText(valueToBeTyped, 50, 100, true);
     Driver.WaitForAjax();
     Driver.WaitUntilReady();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Simulate real typing by double clicking on the element and typing with the keyboard. Accepts html control, text and delay in milliseconds.
 /// </summary>
 /// <param name="control">Html control to type in</param>
 /// <param name="text">Text to type</param>
 /// <param name="delay">Delay between key strokes</param>
 public void SimulateRealTyping(HtmlControl control, string text, int delay = SimulateRealTypingDelay)
 {
     this.manager.ActiveBrowser.Window.SetFocus();
     control.Focus();
     control.MouseClick();
     control.MouseClick();
     this.manager.Desktop.KeyBoard.TypeText(text, delay);
     this.manager.Desktop.KeyBoard.KeyPress(Keys.Enter, delay);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Simulate real typing by double clicking on the element and typing with the keyboard. Accepts html control, text and delay in milliseconds.
 /// </summary>
 /// <param name="control">Html control to type in</param>
 /// <param name="text">Text to type</param>
 /// <param name="delay">Delay between key strokes</param>
 public void SimulateRealTyping(HtmlControl control, string text, int delay = SimulateRealTypingDelay)
 {
     this.manager.ActiveBrowser.Window.SetFocus();
     control.Focus();
     control.MouseClick();
     control.MouseClick();
     this.manager.Desktop.KeyBoard.TypeText(text, delay);
     this.manager.Desktop.KeyBoard.KeyPress(Keys.Enter, delay);
 }
Ejemplo n.º 4
0
        private void htmlNavigateComplete(object sender, BrowserNavigateComplete2Event e)
        {
            string url = e.url;

            Trace.WriteLine("htmlNavigateComplete(): " + e.url);
            bool rootPage = e.IsRootPage;

            if (rootPage)
            {
                if (url != "about:blank")
                {
                    textUrl.Text = url;
                }
                htmlControl1.Focus();
            }

            HTMLWindowEvents2_Event window = (HTMLWindowEvents2_Event)htmlControl1.Document2.GetParentWindow();

            window.onerror += this.WindowError;
        }
Ejemplo n.º 5
0
        public void EditField(string controlName)
        {
            HtmlDiv     frontendPageMainDiv  = BAT.Wrappers().Frontend().Pages().PagesWrapperFrontend().GetPageContent();
            HtmlControl inlineEditingControl = frontendPageMainDiv.Find.ByExpression <HtmlControl>("class=sfFieldEditable", "name=" + controlName);

            inlineEditingControl.Focus();
            inlineEditingControl.MouseClick();

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.WaitForAsyncJQueryRequests();
            ActiveBrowser.RefreshDomTree();
        }
        /// <summary>
        /// Selects the file.
        /// </summary>
        /// <param name="fileName">Name of the file.</param>
        public void SelectFile(string fileName)
        {
            ActiveBrowser.RefreshDomTree();
            HtmlUnorderedList fileTree = EM.ScriptsAndStyles.ScriptsAndStylesEditScreen.FileTree
                                         .AssertIsPresent("File tree");

            HtmlControl cssFile = fileTree.Find.ByExpression <HtmlControl>("InnerText=" + fileName);

            cssFile.Focus();
            cssFile.MouseClick();

            ActiveBrowser.WaitUntilReady();
            ActiveBrowser.RefreshDomTree();
        }
Ejemplo n.º 7
0
 public void Focus()
 {
     HtmlControl.Focus();
 }
Ejemplo n.º 8
0
 public void EditListItemClick(HtmlControl control, string strText)
 {
     MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
     Thread.Sleep(3000);
     control.Focus();
     ICollection<Element> ele = control.ChildNodes;
     foreach (Element e in ele)
     {
         if (e.InnerText == strText)
         {
             (new HtmlControl(e)).Click();
             MouseKeyboardLibrary.KeyboardSimulator.KeyPress(System.Windows.Forms.Keys.Tab);
             break;
         }
     }
 }