I register the following function
//EDIT: updated $("#id").on("change", function() { alert('xxx'); });
In my IE console I did
document.getElementById('id').onchange();
and it says element this does not have property or value.
I am trying to run automation test using
selenium.runScript("document.getElementById('id').onchange();");
What are ways around this? In IE I get JavaScript error popping up, thus stopping rest of the test.
Advertisement
Answer
Thanks I found the answer. I had to use
selenium.runScript($("#id").change());
even if I had added the missing quote.
If you register listener with on it doesn’t get register by the dom’s onchange event.