Using Selenium Web Driver to retrieve value of a HTML input (C#)
To get the text entered into an input element, use element.getAttribute("value") where element is the input element. The attribute text is used to get the text from the tags within an element.
IWebElement query = driver.FindElement(By.Id("searchInput")); query.SendKeys("the moon"); MxService.AddLogLine(query.GetAttribute("value"));
Leave a reply
Your email address will not be published. Required fields are marked*