/// <summary> /// Initializes a new instance of the Finder class. /// </summary> /// <param name="driver">InternetExplorerDriver in use</param> /// <param name="parent">ElementHandle to for use with the Native methods</param> public Finder(InternetExplorerDriver driver, SafeInternetExplorerWebElementHandle parent) { this.driver = driver; if (parent != null) { this.parent = parent; } else { this.parent = new SafeInternetExplorerWebElementHandle(); } handle = driver.GetUnderlayingHandle(); }
/// <summary> /// If this current element is a form, or an element within a form, then this will be submitted to the remote server. If this causes the current page to change, then this method will block until the new page is loaded. /// </summary> /// <param name="attributeName">Attribute you wish to get details of.</param> /// <returns>The attribute's current value or null if the value is not set.</returns> public string GetAttribute(string attributeName) { SafeStringWrapperHandle stringHandle = new SafeStringWrapperHandle(); SafeInternetExplorerDriverHandle driverHandle = driver.GetUnderlayingHandle(); WebDriverResult result = NativeDriverLibrary.Instance.GetElementAttribute(driverHandle, elementHandle, attributeName, ref stringHandle); ResultHandler.VerifyResultCode(result, string.Format(CultureInfo.InvariantCulture, "getting attribute '{0}' of the element", attributeName)); string returnValue = null; using (StringWrapper wrapper = new StringWrapper(stringHandle)) { returnValue = wrapper.Value; } return(returnValue); }
/// <summary> /// Initializes a new instance of the Finder class. /// </summary> /// <param name="driver">InternetExplorerDriver in use</param> /// <param name="parent">ElementHandle to for use with the Native methods</param> public Finder(InternetExplorerDriver driver, SafeInternetExplorerWebElementHandle parent) { this.driver = driver; this.parent = parent; handle = driver.GetUnderlayingHandle(); }