/// <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); }
public string GetAttribute(string attributeName) { if (WrappedElement == null) { return(""); } return(WrappedElement.GetAttribute(attributeName)); }
public new virtual string GetText() { var text = base.GetText(); if (string.IsNullOrEmpty(text)) { return(WrappedElement.GetAttribute("value")); } return(text); }
internal bool GetIsCheckedValue() { string value = WrappedElement.GetAttribute("value"); if (value == "1") { return(true); } else { return(false); } }
/// <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))); }
/// <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); }
/// <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)); }
protected virtual string GetClassAttribute() { return(string.IsNullOrEmpty(WrappedElement.GetAttribute("class")) ? null : WrappedElement.GetAttribute("class")); }
protected bool GetDisabledAttribute() { string valueAttr = WrappedElement.GetAttribute("disabled"); return(valueAttr == "true"); }
internal string GetInnerHtmlAttribute() { return(WrappedElement.GetAttribute("innerHTML")); }
internal string DefaultGetValue() { return(WrappedElement.GetAttribute("value")); }
internal bool GetIsChecked() { return(bool.Parse(WrappedElement.GetAttribute("checked"))); }
public string GetReference() { return(WrappedElement.GetAttribute("href")); }
public string GetAttribute(string attributeName) { UpDriver.WaitForPageReady(); Log.GetLogger().Info($"Getting [{attributeName}] attribute for element [{ElementIdentifier}]"); return(WrappedElement.GetAttribute(attributeName)); }
/// <summary> /// Gets the value of the specified attribute for this element. /// </summary> public string GetAttribute(string attributeName) { NgDriver.WaitForAngular(); return(WrappedElement.GetAttribute(attributeName)); }