I am trying to using javascript to login to a webpage, however, the page gives an error saying "username/password field is empty" even though the text is clearly inputed. Here is how I enter the username/password using javascript.
document.getElementById('username').value='TestUsername';
document.getElementById('password').value='TestPassword';
I believe the page is using angularJS to block the javascript input from being recognized. If I manually in browser backspace one character, the text is recognized. Chrome/Safari/Opera autofill are able to get around this, however mobile safari has issues occasionally.
How can I, using javascript, make it so the text being inputted is recognized by the webpage?
Another note, the HTML class of elements such as the username, password, form, and submit button all change class when text is recognized from something like "ng-touched ng-dirty ng-invalid" to "ng-touched ng-dirty ng-valid". I have tried using javascript to change the className, however the text still isn't recognized.