Visual Studio Code – Getting an error 'TypeError: Cannot read properties of undefined (reading 'setAttribute')' while setting an attribute for the input webelement
I am trying to set an attribute for the input tag webelement for the value but actually I am getting this below error Below is the code which I have written for this, 'document.getElementsByName('date')[0].setAttribute('value','2022-11-29');' and the below error is getting…