JavaScript code is not working as expected, the code input the text in the specified field, but the text is not recognized

Hi everyone,

I am learning to use javascript instead of activities like “Type Into and Click” to automate login process

I am using javascript to login to Spotify

Steps (using “Inject JS” activity):
1-Type user name
2-Type password
3-Click login button

The code types the username and password but the username and password feilds are not recognizing the text, like there is no text inside it as shown in the following picture:

Script code:

Screenshot (52)

Input parameter:

Screenshot (54)

Username field HTML code (before running the project):

Username field HTML code (after running the project):

Password field HTML code (before running the project):

Password field HTML code (after running the project):

Hope I asked the question properly

Appreciate your help

Hi, i hope you are doing this just for learning purposes… With that said, your questions is more about javascript and spotify website than it is uipath, so i my opinion the problem seem to be with the way the application validates those fields…

the best way to start with inject js is to explore the component step by step

first round:
let alert the passed input

  • indicate with the selector the html element or webpage
  • do not change the parameter input to any other name
  • pass the input value properly

Once this is working then integrate more and more by step by step. We encountered that when we pass the uielement instead using the selector we got less issues during the development phase