Ask a Question

Uncaught TypeError: Cannot set properties of undefined (setting 'value')] while generating token

brindhavananb
Occasional Contributor

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:

brindhavananb_0-1699527496466.png

Error:

brindhavananb_1-1699527526715.png 

brindhavananb_3-1699527660617.png

 

 

0 REPLIES 0
cancel
Showing results for 
Search instead for 
Did you mean: