Uncaught TypeError: Cannot set properties of undefined (setting 'value')] while generating token
I have tried to create authentication token in ReadyAPI using "Auth2.0" with "Implicit Grant".
I can create it manually by clicking on "Get access token" button by passing all required parameters.
But when i tried to give javascript and create it automatically from "Automation script" tab, it is throwing below error.
Uncaught TypeError: Cannot set properties of undefined (setting 'value')]
I have also tried with below scripts to set value.
1) document.getElementsByName("loginfmt")[0].value = "123@gmail.com";
2) document.getElementById("i0116").value = "123@gmail.com";
3) document.getElementsByClassName("form-control ltr_override input ext-input text-box ext-text-box").value = "123@gmail.com";
4) document.getElementById("i0116").setAttribute("placeholderText", "123@gmail.com");
The above scripts are working fine when i executed in console tab from dev tool.
But not working in ReadyAPI.
Can anyone help me on this issue?
Java Scripts:
Error: