BitrixAQA.Selenium.Framework.WebItem.GetAttribute C# (CSharp) Метод

GetAttribute() публичный Метод

Получает значение указанного атрибута WebItem. Аналог WebDriver.GetAttribute()
public GetAttribute ( string attributeName, bool writeToLog = false ) : string
attributeName string Название атрибута, значение которого надо выбрать
writeToLog bool Записать в лог значение атрибута, true - записать в лог, false (по умолчанию) - не записывать
Результат string
        public string GetAttribute(string attributeName, bool writeToLog = false)
        {
            string value;

            if (BitrixFramework.FindWebElement(this).GetAttribute(attributeName) != null)
            {
                value = BitrixFramework.FindWebElement(this).GetAttribute(attributeName);

                if (writeToLog)
                    Log.MesNormal(String.Format("'{0}' Значение атрибута: '{1}'", description, value));

                return value;
            }
            else
            {
                value = null;

                if (writeToLog)
                    Log.MesError(String.Format("Атрибут {0} не найден", attributeName));

                return value;
            }
        }