<commit_before>using TestStack.Seleno.Extensions;

namespace TestStack.Seleno.PageObjects.Controls
{
    public abstract class InputHtmlControl : HTMLControl
    {
        public string Value
        {
            get { return ValueAs<string>(); }
        }
        
        public virtual TReturn ValueAs<TReturn>()
        {
            var scriptToExecute = string.Format("$('#{0}').val()", Id);
            return Execute.ScriptAndReturn<TReturn>(scriptToExecute);
        }

        public void ReplaceInputValueWith<TProperty>(TProperty inputValue)
        {
            var scriptToExecute = string.Format(@"$('#{0}').val(""{1}"")", Id, inputValue.ToString().ToJavaScriptString());
            Execute.Script(scriptToExecute);
        }
    }
}<commit_msg>#181 proposed change to use the name not id<commit_after>using TestStack.Seleno.Extensions;

namespace TestStack.Seleno.PageObjects.Controls
{
    public abstract class InputHtmlControl : HTMLControl
    {
        public string Value
        {
            get { return ValueAs<string>(); }
        }

        public virtual TReturn ValueAs<TReturn>()
        {
            var scriptToExecute = string.Format(@"$('[name=""{0}""').val()", Name);
            return Execute.ScriptAndReturn<TReturn>(scriptToExecute);
        }

        public void ReplaceInputValueWith<TProperty>(TProperty inputValue)
        {
            var scriptToExecute = string.Format(@"$('[name=""{0}""]').val(""{1}"")", Name, inputValue.ToString().ToJavaScriptString());
            Execute.Script(scriptToExecute);
        }
    }
}
{'fraction_non_alphanumeric': 0.1316793893129771, 'fraction_numerical': 0.0057251908396946565, 'mean_word_length': 2.6160919540229886, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4668577', 'n_tokens_mistral': 434, 'n_tokens_neox': 422, 'n_words': 78}