Macro hates it when you call the username user_name.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Macro hates it when you call the username user_name.

Post by tommytx » Sat Nov 26, 2005 1:32 am

I'm back. I apologize if this shows up someplace else, it disappeared so I sent it again. If duped somewhere, pls delete and accept my apology.

I just seem to get out of one mess into another, the recorder was doing fine till I got to this problem. I know it is not a fault of the recorder, but a fault of the script.
My basic test file is below an htm file.
I don't have the luxury to change the name used for the user. They are using the name=user_name and your script don't like that. Is there a work around this?
It will not fill in the username unless I change the name-user_name to something like user_same or user_bame or etc. anything works except user_name. The macro will not let me use user_name to hold the variable for username. That is odd - huh?

any suggestions. I am pulling out my hair.


pass.htm
*********


username :

password :





Script File
***********

LibLoad>IEAuto.dll,hIE
Let>delay=1
Wait>delay
LibFunc>hIE,CreateIE,IE[0],0
LibFunc>hIE,Navigate,r,%IE[0]%,C:\temp\pass.htm
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>delay

### Enter user name ###
Let>FieldName=user_name
Let>FieldValue=tommytango
LibFunc>hIE,FormFill,r,%IE[0]%,,str:FieldName,str:FieldValue,0

### Enter password ###
Let>FieldName=user_pass
Let>FieldValue=secret409
LibFunc>hIE,FormFill,r,%IE[0]%,,str:FieldName,str:FieldValue,0

LibFree>hIE

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Nov 26, 2005 9:33 am

When I first read that I thought that was really weird. Then I realised that USER_NAME is a system variable (see system variables in the help file). So to fix it we need to force the script to treat user_name as a literal. Like this:

Let>FieldValue={"user_name"}

If you make that change it will work! :-)
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sat Nov 26, 2005 3:10 pm

You are soooooo.... good!

Thanks for not saying why don't you just use a different variable. Of course I can't do that as I am scripting someone else's program. They probably would not take kindly to me telling them to change their program so I can script it better. Especially when they don't want me to script it anyway.

Thanks again.

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sat Nov 26, 2005 3:28 pm

OOPS! You may have mis-understood the problem.

The problem is not with FieldValue=tommytango, the acutal problem is with the FieldName=user_name.

I tried this but no work: Let>FieldName={"user_name"}

You gave me a fix for FieldValue vice FieldName.
Let>FieldValue={"user_name"}


### Enter user name ###

The problem is the line below:
*************************
Let>FieldName=user_name
*************************
Let>FieldValue=tommytango
LibFunc>hIE,FormFill,r,%IE[0]%,,str:FieldName,str:FieldValue,0

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Nov 26, 2005 4:27 pm

Ok, so what I meant was:

Let>FieldName={"user_name"}

My typo.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sat Nov 26, 2005 5:57 pm

Quote from above:
***********************************************
I tried this but no work: Let>FieldName={"user_name"}
***********************************************

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sat Nov 26, 2005 6:01 pm

However the below works fine, if I change it in the source also and as we know that won't be possible normally. I changed it in the test source fine.

*************************
Let>FieldName=user_name_1
*************************

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Nov 26, 2005 6:15 pm

Works for me!! Have an exact copy of your test html page and it fills both input boxes quite happily. Am using:

Let>FieldName={"user_name"}

If you step through with the debugger you will see that FieldName is set correctly.

Perhaps you have an older version of Macro Scheduler? You need 7.3 or above for the {"user_name"} syntax.

Seriously, it works perfectly, I tested my suggested fix before I posted it - I never post without verifying it will work first. So either you have an out of date version or your problem is something else.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sat Nov 26, 2005 9:03 pm

It works wonderful for me also on win98 and all the computers I don't need it to run on. My computer is running XP PRO and I think it is the reason it won't work. Has there been a lot of XP Pro testing also?
Even on Win98, I needed to use the {"user_name"} but you are right it works fine. Just not on XP PRO!

The actual htm file I am testing is at http://www.vahud.com/pass.htm

The actual failing code is below: Appears to be an operating system pain.

Let>FieldName={"user_name"}
Let>FieldValue=tommytango
LibFunc>hIE,FormFill,r,%IE[0]%,,str:FieldName,str:FieldValue,0


When I used debugger, I saw the "USER_NAME" the system was using for itself that you had mentioned. On my XP Pro the USER_NAME=Tom Chambers and on my Win 98 it is coincidentally USER_NAME-tommytx but that is ok as it works fine on win 98

Hey! I saw the banner on your front page with my name. Looks good!

Thanks for your assistance.

Tom Chambers

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Nov 26, 2005 9:13 pm

Yep, I'm running on XP Pro. No problems. Just tried it with vahud.com/pass.htm and it worked perfectly, putting tommytango into the username field.

We develop on XP Pro and test extensively on Windows 95, 98, NT, 2000, XP and 2003.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sat Nov 26, 2005 9:44 pm

Ok thanks for the help anyway, I guess I have a strange computer. Last year I was running XP and the httprequest command caused a lock up if you called it more than once and we never could figure that one out either, and no-one else could dupe it. Ichanged to XP Pro and that problem went away.

Guess I will use the Gui to bypass this, but was looking so forward to the new commands in the Recorder. Anyway most of them seem to work for me.

This is really a strange one, I can change any letter in the word "user_name" and works fine. But not with that exact word.

Thanks again.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Nov 27, 2005 8:39 am

Tom,

If you like download our remote desktop support files from the support page and drop me a line by email and I'll take a look at your desktop and debug the script myself and see if I can see why its not working. I'm sure there must be an explanation, 'cos it works pefectly for me. Be happy to take a look myself.

But before we try that please add this line *after* the Let>FieldName={"user_name"} line:

MessageModal>FieldName

Also do Edit/Remove Trailing Spaces

Run the script and report back on what the message box says. It *should* say user_name
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

tommytx
Pro Scripter
Posts: 61
Joined: Mon Dec 22, 2003 3:20 am

Post by tommytx » Sun Nov 27, 2005 4:08 pm

I monitored all that during the debug. I used
MessageModal>%FieldName% %FieldValue%
thruout the script and it always had the correct data including the use_name and the correct user name. Even along the border, the monitor showed that FieldName was being set to "user_name" and FieldValue was being set to "tommytx", but when I stepped thru or used run it did not fill the User Name box with anything.

However, right below this command the password box was being filled in correctly.

Simply change any letter of the word user_name in the script and also in the htm file and it works great. On machines other than XP Pro it works just fine with the word user_name.

I will download the desktop software and let you know when ready.

We tried that a couple of years ago when fighting with another problem.

If more than one call to the HTTPREQUEST in a row locks the computer and we never did solve that. To run more than one httprequest, it was necessary to totally close the macro program and restart it. then it would do one request and one only or lockup of the entire computer occurred.

Strangely enough, this is the same computer but it was running XP home at that time and the request was just fine on my other non XP computers. Now I am running XP Pro and the http request is fine, but now have developed this weirdo.

I am certainly interested in getting to the bottom if you have time, but I understand these unusual cases unless lots of other are ailing sometimes make it not worth your time.
Thanks a lot.
Will let you know when the software is ready.

Tom

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts