Beispiel #1
0
 public void Clear()
 {
     Do(() =>
     {
         WebElement.Clear();
     });
 }
Beispiel #2
0
 /// <summary>
 /// Clears the value of an element.
 /// </summary>
 public void Clear()
 {
     _session.Logger.WriteLine("Clearing " + this);
     if (WebElement.GetAttribute("readonly") == "true")
     {
         throw new InvalidOperationException("Cannot clear a readonly element.");
     }
     WebElement.Clear();
 }
        public void ClearFirstSendKeys(string text)
        {
            if (text == null)
            {
                text = string.Empty;
            }

            WebElement.Clear();
            WebElement.SendKeys(text);
        }
Beispiel #4
0
        public void SetPassword(string text)
        {
            WebElement.Clear();        // clear the text field
            WebElement.SendKeys(text); // set the new value in the text field

            string message = $"The (Text Field) [ {ControlName} ] set the password value: [ *********** ].";

            LoggerManagerClass.Instance.Information(message);
            TestCaseProvider.Instance.AddStepInCurrentTestCase(LogStepStatus.Passed, message);
        }
Beispiel #5
0
 /// <summary>
 /// Clear the element content. This is usually used on a user editable field element.
 /// </summary>
 public void Clear()
 {
     if (WebElement != null)
     {
         WebElement.Clear();
     }
     else
     {
         LogManager.Error("Unable to clear the requested element");
     }
 }
Beispiel #6
0
        public void SetDateValue(string text)
        {
            WebElement.Clear();        // clear the text field
            SeleniumActions.BrowserSleep(10);
            WebElement.SendKeys(text); // set the new value in the text field

            string message = $"The (Text Field) [ {ControlName} ] set the value: [ {text} ].";

            LoggerManagerClass.Instance.Information(message);
            TestCaseProvider.Instance.AddStepInCurrentTestCase(LogStepStatus.Passed, message);
        }
Beispiel #7
0
 public void SetValue(string Text)
 {
     try
     {
         WebElement.Clear();
     }
     finally
     {
         WebElement.SendKeys(Text);
     }
 }
Beispiel #8
0
        /// <summary>
        /// Sends text to the element via keystrokes. If this element is a select element, then this selects the appropriate option instead of sending keystrokes.
        /// </summary>
        /// <param name="text">The text to send.</param>
        public void Write(string text)
        {
            _session.Logger.WriteLine("Writing " + text + " to " + this);
            if (WebElement.TagName != "select")
            {
                if (WebElement.GetAttribute("readonly") == "true")
                {
                    throw new InvalidOperationException("Cannot write to a readonly element.");
                }
                WebElement.Clear();
                WebElement.SendKeys(text);
                return;
            }

            var option = _session.FindElements(WebElement, "option[text()=" + Utility.CssString(text) + "] | option[@value=" + Utility.CssString(text) + "]").FirstOrDefault();

            if (option == null)
            {
                throw new InvalidDataException("Element " + this + " does not contain option " + text);
            }
            option.WebElement.Click();
        }
 public void Clear()
 {
     LOG.Information("Clearing element: {0}", WebElement);
     WebElement.Clear();
 }
 public void Clear()
 {
     WebElement.Clear();
 }
Beispiel #11
0
 /// <summary>
 /// Removes content of element.
 /// </summary>
 public ElementWrapper Clear()
 {
     WebElement.Clear();
     Wait();
     return(this);
 }
Beispiel #12
0
 public void SetValue(string text)
 {
     WebElement.Clear();
     WebElement.SendKeys(text);
     //LOG
 }
Beispiel #13
0
 void IWebElement.Clear()
 {
     WebElement.Clear();
 }
Beispiel #14
0
 public void SetText(string text)
 {
     WebElement.Clear();
     WebElement.SendKeys(text);
 }
Beispiel #15
0
 public void Fill(string value)
 {
     WebElement.Clear();
     WebElement.SendKeys(value);
 }
Beispiel #16
0
 public void Clear()
 {
     DoAction(() => WebElement.Clear());
 }
Beispiel #17
0
 public void SetText(string text)
 {
     // Clear the text box prior to entry
     WebElement.Clear();
     WebElement.SendKeys(text);
 }
 public void ClearText()
 {
     WebElement.Clear();
     WebElement.SendKeys(Keys.Enter);
 }
Beispiel #19
0
 public virtual void Clear()
 {
     WebElement.Click();
     WebElement.Clear();
 }
Beispiel #20
0
 public void ClearText()
 {
     EnsureElementExists();
     WebElement.Clear();
 }
 public void SetValue(string Text)
 {
     WebElement.Clear();
     WebElement.SendKeys(Text);
 }
Beispiel #22
0
 public void SendKeys(string keys)
 {
     EnsureElementExists();
     WebElement.Clear();
     WebElement.SendKeys(keys);
 }