Jump to content
Sign in to follow this  
shay

automation freeze

Recommended Posts

shay

hi

i use AutoIt to preform automation system testing

i test win XP embedded system,

my script preform system restart , several task, log, then restart

after couple of runs the win is up but the script is frozen (some times 70 cycles some time 10 then freeze)

any idea what can i cheek?


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
Manjish

what do mean by "frozen".. check lines in ur code which make the script pause till a condition is achieved.. like WinWaitActive.. or msgbox.. or i/p box.. or a while loop which never exits.. post ur script for furthur analysis


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
Share on other sites
shay

i have several "sleep" and "WinActivate" etc...

i start my script by placing a shortcut in the start up folder,

when the OS is halfway up then the system freeze.(i see the cursor ant the wallpaper)

didn't encounter this without AutoIT

$path = "d:\restart.ini"
    $ini = IniRead($path, "restart_count", "restart_number", "0")

if MsgBox(266513,"Automation", "Automation restart activated " & @crlf & @crlf &  $ini &" Loop Remain " & @crlf & @crlf & "Press CANCEL to abort.",5) = 2 Then
    MsgBox(0,'','Terminating Automation ' ,3)
    Exit
Else
    
; Count loop
sleep(200)
$path = "d:\restart.ini"
$ini = IniRead($path, "restart_count", "restart_number", "0")
if $ini >= 1 then
    $ini = $ini - 1
    IniWrite($path, "restart_count", "restart_number", $ini)
    
    
;look for Start then press button
sleep(180000)
WinActivate("LU-30")
$text = WinWait ( "LU-30", "Connect", 60)
    if $text = 1 Then
        Sleep(500)
        ControlClick("LU-30", '' , "Connect")
        sleep(180000)
    Else
        MsgBox(4096, "Automation", "Error: Unable to find -=Connect=- button stopping Automation process")
        Exit
    EndIf
        
; read Sleep from INI file 
Sleep(1000)
    $path = "d:\restart.ini"
    $ini = IniRead($path, "sleep_time", "sleep", "0")
    sleep(500)
    MsgBox(0,"Automation",'-    Going to sleep for '& $ini & ' milliseconds' ,3)
    sleep(500)
    sleep($ini)  ; sleep from INI
    MsgBox(0,'','-    Done sleeping  !! ' ,3)

;look for word in the GUI append to log
$path = "d:\restart.ini"
WinActivate("LU-30")
$error = WinWaitActive("LU-30", "Connected: 7" , 20)
    if $error = 0 Then
        MsgBox(16, "Automation", "Automation: Connected Modems is different than defined " ,5)
        Sleep(200)
        ;log to file error
            $file = FileOpen("d:\restart.log", 1)
            FileWriteLine($file,  @Hour & ":" & @Min & ":" & @Sec & ", Connected Modems is less than defined ") 
            FileClose($file)
        sleep(10000)
    Else
        MsgBox(16, "Automation", "Automation: Connected Modems OK ,"& @crlf & @crlf & "Restarting the system", 5)
        Sleep(200)
        ;log to file OK
            $file = FileOpen("d:\restart.log", 1)
            FileWriteLine($file,  @Hour & ":" & @Min & ":" & @Sec & ", Restart ") 
            FileClose($file)
    sleep(10000)
    EndIf


;Restart
    ;Run(@COMSPEC & " /c ewfmgr c: -commitanddisable")
    Sleep(1000)
    Run(@COMSPEC & " /c shutdown -r -t 3")
    
Else 
Sleep(200)
;log last restart
$file = FileOpen("d:\restart.log", 1)
    FileWriteLine($file, @Hour & ":" & @Min & ":" & @Sec & " ,End of automation  ") 
    FileClose($file)
    Sleep(200)
MsgBox(0,'','This was the last Automation restart cycle . ' )
Sleep(300)

filemove( "d:\restart.log", "d:\RestartLog.log", 1)
Sleep(600)
$log =  FileExists( "d:\RestartLog.log") 
    if $log = 1 Then
        FileDelete( "d:\restart.log" )
Else
EndIf

endif
EndIf
Edited by shay

"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
herewasplato

Is the "D" drive local or networked?

Just grasping at straws here...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
shay

Is the "D" drive local or networked?

Just grasping at straws here...

D:\ is local


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
herewasplato

You said that you see "cursor and the wallpaper" when it freezes.

It would be nice to know if the AutoIt script has even loaded yet.

Can you run ...PStools\pslist.exe against this XP embedded system from another computer?


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
shay

You said that you see "cursor and the wallpaper" when it freezes.

It would be nice to know if the AutoIt script has even loaded yet.

Can you run ...PStools\pslist.exe against this XP embedded system from another computer?

unfortunately the OS is frozen so i cant run PSLIST or so,

dose the script itself look OK?


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
herewasplato

... dose the script itself look OK?

Yes. Nothing in there that could make it hang, but I doubt that the script has loaded at that point your describe the freeze.

Maybe you could add a Beep(500, 1000) to the start of the script and compare when you hear that during a normal start up to the point that you see the freeze. Make sense?

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
shay

Maybe you could add a Beep(500, 1000) to the start of the script and compare when you hear that during a normal start up to the point that you see the freeze. Make sense?

make lot of sense,

but the unit that i test dose not react to beep command, ( this is not a standard mother board )


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
herewasplato

bummer - then just add a traytip and you will probably see that the AutoIt script loads several seconds after the desktop icons.

So, if you uninstall AutoIt and just use a simple batch file to loop restarts; does the system in question ever "freeze"?


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
shay

bummer - then just add a traytip and you will probably see that the AutoIt script loads several seconds after the desktop icons.

So, if you uninstall AutoIt and just use a simple batch file to loop restarts; does the system in question ever "freeze"?

i cant use batch file for the loop, i have to preform the "sleep"

i`ll will investigate other issues on my system, perhaps it`s not the AutoIT that freezes the unit.

thank you all for your help

AutoIT rules!!! >_<


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
herewasplato

i cant use batch file for the loop, i have to preform the "sleep" ...

Right, but as a test - I thought something like this might do:

shutdown -r -t 1111

That gives a delay of about 18 minutes

And...

shutdown -r -t 1111111

...gives a delay of about 12 days

Maybe you can find some middle ground :-)

I know that you are doing more than just restarting the system - this was just a test to see if the system will hang all on its own every 70 to 100 restarts.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
shay

I know that you are doing more than just restarting the system - this was just a test to see if the system will hang all on its own every 70 to 100 restarts.

i`ll will try this,

i think that the problem is the start up procedure,

because my software and the script starting at the same time (Windows start up folder)

is is passable to delay between the 2 software?


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites
herewasplato

i`ll will try this,

i think that the problem is the start up procedure,

because my software and the script starting at the same time (Windows start up folder)

is is passable to delay between the 2 software?

You could just have the AutoIt script start the app or use go old DOS again:

Start one thing (script or app) via the first line of a batch file... then make this the second line:

ping -n 100 127.0.0.1

that will delay the third line from starting for 100 seconds... add more seconds if you want.

the 3rd line of the batch file can start the second thing (script or app).


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
shay

You could just have the AutoIt script start the app or use go old DOS again:

exactly what i was thinking about >_<


"If the facts don't fit the theory, change the facts." Albert Einstein

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.