Beispiel #1
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);
 }
Beispiel #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);
 }
 public void ClickCurrentButton(User currentUser, HtmlControl navigationButton)
 {
     this.NavigateToMainPage(currentUser);
     navigationButton.MouseClick();
     ExecutionDelayProvider.SleepFor(2000);
     this.Browser.RefreshDomTree();
 }
 public void SimulateRealTyping(string valueToBeTyped)
 {
     HtmlControl.Focus();
     HtmlControl.MouseClick();
     Manager.Current.Desktop.KeyBoard.TypeText(valueToBeTyped, 50, 100, true);
     Driver.WaitForAjax();
     Driver.WaitUntilReady();
 }
 public static void ClickObject(HtmlControl objectToClick, bool clickToVisible=false) 
 {
     Manager.Current.ActiveBrowser.RefreshDomTree();
     Manager.Current.ActiveBrowser.WaitUntilReady();
     if (clickToVisible)
         objectToClick.ScrollToVisible();
     objectToClick.MouseClick(); 
 }
        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();
        }
        public void WebTest3_CodedStep()
        {
            foreach (HtmlTableRow row in Pages.TelerikSample0.InboxTable.Rows)
            {
                // the date will always be in the third cell of the table row
                HtmlControl checkBox = FindElementHelper.FindControlInTableCell(row, "Wed");

                if (checkBox != null)
                {
                    checkBox.ScrollToVisible(); //Make sure we see the object before we click it
                    checkBox.MouseClick();      // MouseClick rather than Click so any existing events will be fired
                }
            }
        }
        /// <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();
        }
Beispiel #9
0
        public void WebTest3_CodedStep()
        {
            foreach (HtmlTableRow row in Pages.TelerikSample0.InboxTable.Rows)
            {
                //                HtmlTableCell c = r.Cells[2]; // the date will always be in the third cell

                //                if (c.TextContent.Contains("Wed"))
                //                {
                //                    HtmlTableCell c1 = r.Cells[0]; // look at the first cell in the row
                //                    HtmlControl checkb = c1.ChildNodes[0].As<HtmlControl>(); // find the checkbox within the cell
                //                    checkb.ScrollToVisible(); //Make sure we see the object before we click it
                //                    checkb.MouseClick();  // MouseClick rather than Click so any existing events will be fired
                //                }

                // the date will always be in the third cell of the table row
                HtmlControl checkBox = FindElementHelper.FindControlInTableCell(row, "Wed");

                if (checkBox != null)
                {
                    checkBox.ScrollToVisible();         //Make sure we see the object before we click it
                    checkBox.MouseClick();              // MouseClick rather than Click so any existing events will be fired
                }
            }
        }