BitrixAQA.Selenium.Framework.WebItem.SendKeys C# (CSharp) Method

SendKeys() public method

Метод посылает указанный текст в WebItem. Опционально - очищать текст в контроле перед посылом. По умолчанию - true, очищать. Аналог WebDriver.FindElement().SendKeys()
public SendKeys ( string text, bool clearBeforeSend = true, bool HideMessage = false, bool checkErrors = true ) : void
text string Текст, который надо послать в WebItem
clearBeforeSend bool Очистить текст в контроле перед посылом текста. true - очистить, false - нет
HideMessage bool Скрывать ли текс в контейнер
checkErrors bool Проверять или нет ошибки
return void
        public void SendKeys(string text, bool clearBeforeSend = true, bool HideMessage = false, bool checkErrors =  true)
        {
            try
            {
                if (clearBeforeSend)
                    BitrixFramework.FindWebElement(this).Clear();

                BitrixFramework.FindWebElement(this).SendKeys(text);
            }
            catch (NullReferenceException)
            {
                Log.MesError("Не найден объект \"" + this.description + "\" по пути \"" + this.by.ToString() + "\"");
                throw;
            }
            if (HideMessage)
            {
                string spanID = DateTime.Now.Ticks.ToString();
                Log.MesNormal("<div style=\"margin: 0px 0px 0px 50px;\"><font size=\"2\" face=\"Verdana\"><a class=\"plus\"" +
                    " href=\"\" onclick=\"return collapse('" + spanID + "', this)\">" + description + "-> Введен текст </a></font></div><br><span style=\"display:none;\" id=\"" + spanID + "\">" +
                    text + "</span>");
            }
            else
                Log.MesNormal(String.Format("'{0}' -> Введен текст '{1}'", description, text));

            if (checkErrors)
                BitrixFramework.CheckJSErrors();
        }