OpenQA.Selenium.Remote.RemoteWebDriver.GetElementFromResponse C# (CSharp) Метод

GetElementFromResponse() приватный Метод

Find the element in the response
private GetElementFromResponse ( OpenQA.Selenium.Remote.Response response ) : IWebElement
response OpenQA.Selenium.Remote.Response Reponse from the browser
Результат IWebElement
        internal IWebElement GetElementFromResponse(Response response)
        {
            if (response == null)
            {
                throw new NoSuchElementException();
            }

            RemoteWebElement element = null;
            Dictionary<string, object> elementDictionary = response.Value as Dictionary<string, object>;
            if (elementDictionary != null)
            {
                string id = (string)elementDictionary["ELEMENT"];
                element = this.CreateElement(id);
            }

            return element;
        }

Usage Example

Пример #1
0
        /// <summary>
        /// Finds a child element matching the given mechanism and value.
        /// </summary>
        /// <param name="mechanism">The mechanism by which to find the element.</param>
        /// <param name="value">The value to use to search for the element.</param>
        /// <returns>The first <see cref="IWebElement"/> matching the given criteria.</returns>
        protected IWebElement FindElement(string mechanism, string value)
        {
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("id", elementId);
            parameters.Add("using", mechanism);
            parameters.Add("value", value);
            Response commandResponse = Execute(DriverCommand.FindChildElement, parameters);

            return(driver.GetElementFromResponse(commandResponse));
        }
All Usage Examples Of OpenQA.Selenium.Remote.RemoteWebDriver::GetElementFromResponse