All,

Help this helps (or NOT!)

After thinking about what Carl said , I came up with this script , using the Block’s to resume from any errors

C          Expressions           On

C          SetVariableValues               ^Filename="c:\nosuchfile.txt"

C          DeleteFile              ^Filename             "NoVerify"

 

C          SetGeneralScriptFailureBlock           "ErrorHandler"

 

B          "1"

C          SetVariableValues               ^BlockID=1

C          Logmessage          "BlockID - 1"

C          OnFileNotExistGoToBlockId            "FileError"             ^Filename            

 

B          "2"

C          SetVariableValues               ^BlockID=2

C          Logmessage          "BlockID - 2"

C          OpenFile                "c:\rubbish.txt"     "Input"   "Read"   "^num" 

C          ReadFileLine        ^num      "^line"

C          Logmessage          ^line

 

B          "3"

C          SetVariableValues               ^BlockID=3

C          Logmessage          "BlockID - 3"

C          OpenFile                ^Filename             "Input"   "Read"   "^num" 

C          ReadFileLine        ^num      "^line"

C          Logmessage          ^line

 

C          GotoBlockId        "End"

 

B          "FileError"

C          LogTestWarning  "File <" & ^FileName & "> Does Not Exist, Create It!"                "Continue to next Block <" ^GoodBlockID=^BlockID + 1 & ">"

C          SetVariableValues               ^GoodBlockID=^BlockID + 1

C          OpenFile                ^Filename             "Output"                "Write"   "^num"

C          PrinttoFile              ^num      "This a line of text"

C          CloseFile                ^num

C          GotoBlockId        ^GoodBlockId

 

B          "ErrorHandler"

C          LogTestWarning  "BlockId <" & ^BlockID & "> Failed, Going To Next Good Block"          "Go to next Good Block " ^GoodBlockID=^BlockID + 1

C          SetVariableValues               ^GoodBlockID=^BlockID + 1

C          GotoBlockId        ^GoodBlockId

 

B          "End"

C          Expressions           Off

 

Obviously the error handling routines have to be solid or you’ll loop for ever.

And obvious overheads are,  setting the variables at each block and having to renumber the blocks of new steps are added.

But I’ve found this to be minor, compared with making the automated script a lot more robust when run unattended.

Russ

 


From: safsdev-rrafs-admin@lists.sourceforge.net [mailto:safsdev-rrafs-admin@lists.sourceforge.net] On Behalf Of Carl Nagle
Sent: 08 May 2006 19:07
To: safsdev-rrafs@lists.sourceforge.net
Subject: RE: [safs-rrafs] Error Handling help!

 

You could consider setting Robot to handle that automatically for you. 

But currently we do not have something like "Resume" or "Resume Next" to dynamically go back to wherever we last were.

 

One way to simulate that is to make such critical sections there own separate step table.  The step table would contain all the records you would expect to be skipped if such a scenario were to occur.  The Step or Suite calling that Step table will just resume on its next record if a failure\branch occurred in the called Step table.  Of course, this won't be practical if you are saying you general want to trap the errors, but not skip any test records when doing so.

 

Carl


From: safsdev-rrafs-admin@lists.sourceforge.net [mailto:safsdev-rrafs-admin@lists.sourceforge.net] On Behalf Of Ball, Russell
Sent: Monday, May 08, 2006 1:14 PM
To: safsdev-rrafs@lists.sourceforge.net
Subject: [safs-rrafs] Error Handling help!

Hi All,

I’m trying to setup a method of capturing any unforeseen errors in the replaying of safs scripts.

i.e. If I get a unexpected window or msgbox appearing I would like to clear this and carry on.

I know I can use SetScriptWarningBlock etc. but how can I get back to where I came from (the line where the error occurred) without having to put block markers on every line executed.

Is there a way to record last line of the script that was executed and jump back?

Any other ideas of Error Handling would be appreciated.

Thanks

Russ


The Northgate IS Content Screening and Inspection system has scanned this message for malicious and inappropriate content and none was found. Please take care when opening attachments even when these are from known and trusted sources.