Script hangs ... ???

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Script hangs ... ???

Post by JonDubya » Fri Mar 21, 2008 11:24 pm

Really strange...
If I just run it, it stops at ~line 69, however if i do the step through, it works fine. Could it be from the IE_Wait? Here's code:

Code: Select all

// Generated by MacroScript WebRecorder 2.01
// Recorded on  Friday, March 21, 2008, at 11:04 AM

//Move the mouse cursor out of harm's way to avoid causing mouseover events to interrupt

Let>delay=1

//Gather needed information from user
Input>asset,Enter Printer Asset Number:
Input>contact,Enter Contact Information:
Input>location,Enter Location Information:
Input>firmware,Enter or Browse for the Firmware File:,C:\x642\X642_LC2.MB.P237.fullnet.ffm
MessageModal>Verify that the printer's IP address is set to 192.168.1.111 before continuing.
//Begin Firmware Update

IE_Create>0,IE[0]

IE_Navigate>%IE[0]%,http://192.168.1.111/,r
IE_Wait>%IE[0]%,r
Wait>delay

IE_Wait>%IE[0]%,r
Wait>delay

IE_Wait>%IE[0]%,r
Wait>delay

IE_Wait>%IE[0]%,r
Wait>delay

Let>FrameName={"left"}
Let>FormName={""}
Let>TagValue={"Configuration"}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue,r

IE_Wait>%IE[0]%,r
Wait>delay

Let>FrameName={"main content"}
Let>FormName={""}
Let>TagValue={"Update Firmware"}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue,r

IE_Wait>%IE[0]%,r
Wait>delay

SetFocus>Lexmark*
Press Tab * 14
Send Character/Text>firmware
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

Let>FrameName={"main content"}
Let>FormName={"codeupdate"}
Let>TagValue={""}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue,r

Wait>160

//End Firmware update
//Begin configuration
Message>Beginning Configuration
Let>FrameName={"left"}
Let>FormName={""}
Let>TagValue={"Configuration"}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue,r

IE_Wait>%IE[0]%,r
Wait>delay
//*****************This is line 69*****************************
Let>FrameName={"main content"}
Let>FormName={""}
Let>TagValue={"Network/Ports"}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue,r

Suggestions/ideas?

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

Post by Marcus Tettmar » Sat Mar 22, 2008 7:35 am

If it works during debug and not when run normally then that shouts "Timing". When you step through you are slowing the script down. So it's telling you you need a longer delay at some point.
Could it be from the IE_Wait
Probably needs more of them, or you need a Wait>. Sometimes the number of IE_Waits required differ at runtime to record-time. Could be something dynamic on the page which is hard to record. Try adding a Wait of a second or two.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Post by JonDubya » Sun Mar 23, 2008 9:12 pm

So i updated my code with MessageModal checkpoints and added a 5 sec wait:

Code: Select all

SetFocus>Lexmark*
Press Tab * 14
Send Character/Text>firmware
IE_FormFill>%IE[0]%,str:FrameName,str:FormName,str:FieldName,str:FieldValue,0,r

Let>FrameName={"main content"}
Let>FormName={"codeupdate"}
Let>TagValue={""}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,INPUT,NAME,str:TagValue,r

Wait>160

//End Firmware update
//Begin configuration
MessageModal>Beginning Configuration
Let>FrameName={"left"}
Let>FormName={""}
Let>TagValue={"Configuration"}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue,r

Wait>5
MessageModal>5sec wait over
Let>FrameName={"main content"}
Let>FormName={""}
Let>TagValue={"Network/Ports"}
IE_ClickTag>%IE[0]%,str:FrameName,str:FormName,A,TEXT,str:TagValue,r
MessageModal>clicked network

But it still does not work! It's like the %IE[0]% isn't working as a reference anymore, well, it works once and then fails. Does this have anything to do with using the SetFocus command? Does that mess up this %IE[0]% variable?

Edit:
Just tried incrementing the IE array var by 1 (%IE[1]%), but that failed with an Access Violation error. Is there a way to print the values of the %IE[x]% array?

JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Post by JonDubya » Sun Mar 23, 2008 9:47 pm

Fixed the problem by just closing and reopening IE. That'll work for me.

JonDubya
Newbie
Posts: 18
Joined: Thu Mar 20, 2008 6:32 pm

Post by JonDubya » Sun Mar 23, 2008 11:20 pm

It did the same thing later on in the code and I think the culprit is the page is 3 frames and the top frame is a printer status. Well that frame auto refreshes every x seconds and sometimes it 404s on the refresh. I think when this happens, it messes with the script's IE window variable or something, causing to not be able to interact with the window any further.

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