I need to read input value of an element and save it to a string variable in my c# windows form application. Is it possible? Here is how I find the element:
IWebElement SearchCounter = Browser.FindElement(By.Id("counter"));
and here is the html code of the element:
<div id="page-content">
<input type="hidden" id="counter" value="355">
If it's not possible to get the value, how can I read this element html source and assign it to a string variable in my app?
I don't get any result using this:
string cs = SearchCounter.GetAttribute("innerHtml");