I'm trying to write a sanity test. Given:
<div id="txt-search-wrapper" class="pull-left non-action">
<span class="search-widget"></span>
<input type="text" class="search-widget" id="txt-search" placeholder="Search">
</div>
If I use either of these in the console, the text will be entered in the search box. If I manually click enter in the ui the search will be performed properly.
document.getElementById('txt-search').value='test'
$('#txt-search').val('test')
However, the following commands will fail to click and perform the search. I've tried to append \r\n to the text but to no avail. I've played around with keypress events too.
document.getElementById('txt-search').click()
$('#txt-search').click()