For the automated robot framework tests, I need to trigger the Enter keypress automatically on updating the value in the textarea using pure JavaScript. (in Console)
Tried the following, but didn't worked
function simulateEnterPress(element) {
e = $.Event("keypress"); // Create a keypress event
e.which = 13; // Set the pressed key to "Enter"
element.trigger(e); // Trigger the event
}
function doAction() {
inputElement = document.getElementById("vJSONValue").value; // Get the input element
inputElement.value = ('[{"label":"oook"}]'); // Set value of the input
simulateEnterPress(inputElement);
}
Updated: