I am trying to enter text into input box using sendkeys or javascript. I can see value entered into input field but when clicking on search button then I am getting an error message that input field cannot be blank.
html is
input id="inputMId" class="" type="text" data-bind="value: mId, onMFieldFocusOut: MId,css{datePicker:isMIdError()}" maxlength="15"
span class="validationMessage" style="display: none;"
span id="MErrorMessage" class="validationMessage" data-bind="text:mErrorMessage,visible:isVisibleMErrorMessage()" style="display: none;"
The code I tried is
element.sendKeys("value")
and
JavascriptExecutor js = (JavascriptExecutor)getDriver();
js.executeScript("document.getElementById('inputMId').value='"+testData.get("MId")+"';");
I am trying this on Internet Explorer 11 using serenity framework.
Above code works perfectly fine on chrome