I would like to automatically login to this example website: https://portal.videc.info/. I'm quiet new to Java Script and can't figure the issue. I'm using the following code to write the values of username and password (not the correct ones):
document.getElementsByTagName('input')[0].value=('userid')
document.getElementsByTagName('input')[1].value=('password')
document.getElementsByTagName('button')[3].click()
The values are shown in the input boxes. After the button gets pressed it says error 11 "credentials incomplete". When I manually (via keyboard input) remove the last character ('d') of the username and the password and add it again it's working and I get the error 12 (invalid credentials). I assume that I can't write the values that way. The Website doesn't recognize any input by using the code. Does somebody knows how I can make this work?
Found a solution in this Thread:
const event = new Event('input', { bubbles: true });
document.getElementsByTagName('input')[0].value=('userid')
document.getElementsByTagName('input')[0].dispatchEvent(event)
document.getElementsByTagName('input')[1].value=('password')
document.getElementsByTagName('input')[1].dispatchEvent(event)
document.getElementsByTagName('button')[3].click()
Thanks @Dhana D. for the hint with Angular!