Hi,
I am new to Fanfare but i do have exposure on scripting using TCL. I feel TCL is flexible as I can acheive anything I want using the if-else since i can insert it wherever I want. But since I am not familiar with the iTest interpreter I am finding it difficult if i apply the same logic which i use in TCL interpreter in itest.
Following are some examples:
Example 1:
While using the Analysis rules I can use an assert processor and based on the Value i can do an action. There are several actions such as AbortExecution, AbortStep, CallProcedure etc
Say I use CallProcedure and call a procedure and now if i need to check the return value of this procedure and then again want to call a procdure, how do i do?
Below if the assert:
if $value == 1
FailTest
CallProcedure <Procedure Name> <---------------------- How do i check the return value of this Procedure and then call another procedure based on the return value.
Example 2:
I can see a command readFile which is used to read the contents of the file. Genereally in TCL what we do is:
TCL:
if {[file exists .....]} {
open ....
and then read
}
or
if {![catch [open file]} {
read the contents of the file
}
Fanfare:
if i directly use readFile and if there is no file present then this step is going to error out. Is there a way that I can use a catch statement or something where I do not want to proceed with the subsequent steps in the procedure if the first step which is readFile errors out. How do i implement this Fanfare testcase?
Please give me some inputs for both these Examples and also please do share any advanced scripting techniques or best practises that some might have come up with so that i can get an idea of how the commands are being implemeted in the fanafare testcases.