Ejemplo n.º 1
0
        /// <summary>
        /// Get an attribute's value in the webelement
        /// </summary>
        /// <param name="attributeName">attribute name</param>
        /// <returns></returns>
        public string GetAttribute(string attributeName)
        {
            var attr = WrappedElement.GetAttribute(attributeName);

            Logger.Info("Returned attribute: '{0}' Value: '{1}' from element {2} .", attributeName, attr, by);
            return(attr);
        }
Ejemplo n.º 2
0
 public string GetAttribute(string attributeName)
 {
     if (WrappedElement == null)
     {
         return("");
     }
     return(WrappedElement.GetAttribute(attributeName));
 }
Ejemplo n.º 3
0
        public new virtual string GetText()
        {
            var text = base.GetText();

            if (string.IsNullOrEmpty(text))
            {
                return(WrappedElement.GetAttribute("value"));
            }

            return(text);
        }
Ejemplo n.º 4
0
        internal bool GetIsCheckedValue()
        {
            string value = WrappedElement.GetAttribute("value");

            if (value == "1")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Gets the buttons.
        /// </summary>
        /// <returns>The collection.</returns>
        public IList <IWebElement> GetButtons()
        {
            var radioName = WrappedElement.GetAttribute("name");

            string xpath;

            if (radioName == null)
            {
                xpath = "self::* | following::input[@type = 'radio'] | preceding::input[@type = 'radio']";
            }
            else
            {
                xpath = string.Format(CultureInfo.InvariantCulture,
                                      "self::* | following::input[@type = 'radio' and @name = '{0}'] | " +
                                      "preceding::input[@type = 'radio' and @name = '{0}']", radioName);
            }

            return(WrappedElement.FindElements(By.XPath(xpath)));
        }
Ejemplo n.º 6
0
        /// <summary>
        /// If overriding don't forget to call base.Load() or make sure to
        /// assign the WrappedElement.
        /// </summary>
        /// <returns></returns>
        /// <exception cref="InvalidElementStateException">
        /// Element is missing the id attribute.
        /// </exception>
        public override ILoadableComponent Load()
        {
            base.Load();

            var id = WrappedElement.GetAttribute("id");

            if (String.IsNullOrEmpty(id))
            {
                throw new InvalidElementStateException("Element is missing " +
                                                       "the id attribute.");
            }

            var indexOfWrappedEl = WrappedElement.GetIndexRelativeToSiblings();

            TagEditorContainerElement = WrappedElement
                                        .GetParentElement()
                                        .Children()
                                        .ElementAt(indexOfWrappedEl + 1);

            return(this);
        }
Ejemplo n.º 7
0
 /// <summary>
 ///     Gets the value of the specified attribute for this element.
 /// </summary>
 /// <param name="attributeName">The name of the attribute.</param>
 /// <remarks>
 ///     The <see cref="M:OpenQA.Selenium.IWebElement.GetAttribute(System.String)" />
 ///     method will return the current value
 ///     of the attribute, even if the value has been modified after the page has been
 ///     loaded. Note that the value of the following attributes will be returned even
 ///     if
 ///     there is no explicit attribute on the element:
 ///     <list type="table">
 ///         <listheader>
 ///             <term>Attribute name</term>
 ///             <term>
 ///                 Value returned
 ///                 if not explicitly specified
 ///             </term>
 ///             <term>Valid element types</term>
 ///         </listheader>
 ///         <item>
 ///             <description>checked</description><description>checked</description>
 ///             <description>
 ///                 Check
 ///                 Box
 ///             </description>
 ///         </item>
 ///         <item>
 ///             <description>selected</description>
 ///             <description>
 ///                 selected
 ///             </description>
 ///             <description>Options in Select elements</description>
 ///         </item>
 ///         <item>
 ///             <description>disabled</description><description>disabled</description>
 ///             <description>
 ///                 Input
 ///                 and other UI elements
 ///             </description>
 ///         </item>
 ///     </list>
 /// </remarks>
 /// <exception cref="T:OpenQA.Selenium.StaleElementReferenceException">
 ///     Thrown when
 ///     the target element is no longer valid in the document DOM.
 /// </exception>
 /// <returns>
 ///     The attribute's current value. Returns a <see langword="null" /> if the
 ///     value is not set.
 /// </returns>
 public string GetAttribute(string attributeName)
 {
     return(WrappedElement.GetAttribute(attributeName));
 }
Ejemplo n.º 8
0
 protected virtual string GetClassAttribute()
 {
     return(string.IsNullOrEmpty(WrappedElement.GetAttribute("class")) ? null : WrappedElement.GetAttribute("class"));
 }
Ejemplo n.º 9
0
        protected bool GetDisabledAttribute()
        {
            string valueAttr = WrappedElement.GetAttribute("disabled");

            return(valueAttr == "true");
        }
Ejemplo n.º 10
0
 internal string GetInnerHtmlAttribute()
 {
     return(WrappedElement.GetAttribute("innerHTML"));
 }
Ejemplo n.º 11
0
 internal string DefaultGetValue()
 {
     return(WrappedElement.GetAttribute("value"));
 }
Ejemplo n.º 12
0
 internal bool GetIsChecked()
 {
     return(bool.Parse(WrappedElement.GetAttribute("checked")));
 }
Ejemplo n.º 13
0
 public string GetReference()
 {
     return(WrappedElement.GetAttribute("href"));
 }
Ejemplo n.º 14
0
 public string GetAttribute(string attributeName)
 {
     UpDriver.WaitForPageReady();
     Log.GetLogger().Info($"Getting [{attributeName}] attribute for element [{ElementIdentifier}]");
     return(WrappedElement.GetAttribute(attributeName));
 }
Ejemplo n.º 15
0
 /// <summary>
 ///     Gets the value of the specified attribute for this element.
 /// </summary>
 public string GetAttribute(string attributeName)
 {
     NgDriver.WaitForAngular();
     return(WrappedElement.GetAttribute(attributeName));
 }