Send command not sending in compiled code

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
knobb490
Newbie
Posts: 2
Joined: Tue Aug 19, 2008 11:48 pm
Location: SLC, UT, USA

Send command not sending in compiled code

Post by knobb490 » Wed Aug 20, 2008 4:37 pm

My aim is to open IE and access a website, enter and submit a trouble ticket, and exit the site.

I've used the following code to accomplish this on my dev PC, and it works both uncompiled and compliled, but can't get it to work on the production pc from the compiled code.

It hangs at the point where I try to send the "tag" variable (assigned as a command line parameter). I run this from the command line as "C:\Macros\troubleticket.exe /tag=120" and here is the code:

Code: Select all

//Check value of tag variable 
If>tag>0,Complete,Error 

Label>Complete 
//Keep the following message on screen until the script finishes. 
let>msg_stayontop=1 
let>msg_height=300 
let>msg_width=500 
let>msg_xpos=0 
let>msg_ypos=0 
Message>PLEASE DON'T TOUCH YOUR SCREEN UNTIL THIS MESSAGE DISAPPEARS. 

//Open IE and go to web page 
ExecuteFile>http://www.webpage.com 
WaitWindowOpen>webpage: Logon* 
Wait>1 
MoveWindow>webpage: Logon*,0,0 
ResizeWindow>webpage: Logon*,796,565 

//login to webpage 
Send>bcmgen 
press tab 
wait>.5 
Send>fishy 
wait>.5 
press tab 
wait>.2 
press enter 

//Enter and submit a new work order 
WaitWindowOpen>webpage: Work Orders* 
wait>.1 
mousemoverel>345,353 
wait>.1 
lclick 
wait>1 
send>tag 
wait>.1 
press tab 
WaitRectChanged>628,344,636,357,0 
wait>.2 
mousemoverel>490,377 
lclick 

//proceed to Logout 
WaitWindowOpen>webpage: WO Confirmation* 
mousemoverel>50,491 
lclick 
waitwindowopen>webpage: Logon* 
closewindow>webpage: Logon* 
WaitWindowClosed>webpage: Logon* 
wait>.2 

//Close Message box 
CloseWindow>Macro Scheduler Message 

Goto>End 

Label>Error 
MessageModal>NEED TAG NUMBER OF THE MACHINE, PLEASE CLICK OK AND TRY AGAIN. 

Label>End 
//end of script 
Also, I've noticed that the WaitRectChanged command doesn't turn green in the editor when I use it. It just stays black. No big deal, just wondering if it should or not.

Thanks, Knobb490

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

Post by Marcus Tettmar » Wed Aug 20, 2008 5:06 pm

Please run the compiled macro with the /LOGFILE= parameter to generate a log file so that we can determine what/when the macro is doing:

e.g.

c:\macros\troubleticket.exe /tag=120 /LOGFILE=c:\ttmacro.log
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

knobb490
Newbie
Posts: 2
Joined: Tue Aug 19, 2008 11:48 pm
Location: SLC, UT, USA

IE tool bars were the problem

Post by knobb490 » Wed Aug 20, 2008 9:02 pm

Marcus,

Thanks for the prompt reply. It got me looking in the right place. It turns out that I "mouse moved" to the wrong location because of differences in IE tool bars between dev and production PCs. The "send" command was just fine. I'll have to figure out how to quickly navigate the webpage using keystrokes vs. mouse moves to avoid that problem. Love this software!!! Love the support even more!!!! Many thanks!

Knobb490

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Aug 20, 2008 9:56 pm

There are more reliable ways to open IE, this thread has some useful suggestions.

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