Search This Blog

August 21, 2018

How to get the value from the textbox in Selenium?

Today one colleague asked me one question. If he entered the value in the textbox, how to get that value from textbox in C# and Selenium ?  

It is simple. You can use GetAttribute("value") to achieve your goal.  

        public string GetTextBoxValue(IWebElement textBoxElement) 
        { 
            return textBoxElement.GetAttribute("value");    
        }