Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one get the value of a text input using Selenium with C#?

Tags:

Using Selenium for .NET, how can I get the current value from a html input?

It's possible to .GetAttribute() to get the value attribute but this is the html attribute rather than the current value entered into the text box; an approach similar to jQuery's .val() rather than jQuery's .attr().

like image 861
StuperUser Avatar asked Nov 21 '13 12:11

StuperUser


1 Answers

Element.Text didn't work for me. I used element.GetAttribute("value")

Check out this Q&A Setting input textbox text and then retrieving it in Specflow & Selenium

like image 154
jolySoft Avatar answered Oct 01 '22 10:10

jolySoft