Login script not working

Hello, I am trying to login with the following script but unable to do so.
Could you please help me with this?

navigate https://www-secure.target.com/gam-login?retainPage=true&lnk=acct_nav_sign_in&origin=http://www.target.com&fromPath=%2F
exec document.getElementById(“logonIdMain”).value=“XXXXXXXXXXX”
execAndWait $(“#logonIdMain”).trigger(“focusout”);
exec document.getElementById(“logonPasswordMain”).value=“XXXXXX”
execAndWait $(“#logonPasswordMain”).trigger(“focusout”);
execAndWait document.querySelector(“#signin-btn”).click();

I have not used scripting a lot but, it looks like you are mixing Jquery syntax with pure javascript code. The exec* commands should contain pure Javascript code in it.

I think jquery also works with exec command because I have other scripts which are working fine with jquery.

The similar script format is working for other websites like amazon and myntra.

Here’s a template for authenticating with a login form:

logData 0 navigate http://www.example.com/login setValue id=u username setValue id=p password submitForm id=login-form logData 1 navigate http://www.example.com/profile/username

For more info see https://calendar.perfplanet.com/2015/using-webpagetest-authentication/

Even this format i tried was not working and i don’t see much error info , could some one help me to get through login