Setting the text of an input text field and then extracting it in Specflow & Selenium

Can someone explain to me why in the following .NET Specflow code, if my textboxElement is empty, then I send him the keys, why does the text remain empty? (when the text of the text field changes on the screen):

textboxElement.SendKeys("John Smith"); var text = textboxElement.Text; // text == "" 

Is it impossible to "update" the value of an element? (or I just missed something really obvious :-))

0
selenium-webdriver specflow
source share
1 answer

Since this is an input element, you need to get its value property as opposed to text .

So:

 textBoxElement.GetAttribute("value"); 
+9
source share

All Articles