Interview Questions

To verify the file, the two files are same and also check whether the data in it is also correct How to do it using verify function?

SilkTest Questions and Anwsers


(Continued from previous question...)

132. To verify the file, the two files are same and also check whether the data in it is also correct
How to do it using verify function?

Answer1:
Use the SystemFunctions in that case
SYS_CompareText
eg.:
letscompare = SYS_CompareText(sFile1,sFile2)

Answer2:
Open SilkTest (7.6 version)
From the Help Menu, select Help Topics. In the SilkTest Help module, click on the Search Tab. Type in the word Verify and then press the ENTER key. A list is displayed including, Verify function. Read that entry.
It explains how to use it and includes an example.

Answer3:
If ur text file is too big then follow this procedure
1) Read the actual text file and put the contents in a list (Say lsActual)
2)Read the expected text file and put the contents in a list (Say lsExpect)
And Read line by line and Print the mismatch line..
Check with the below code.It will work ..
[+] for ( iLine = 1 ; iLine <= ListCount (lsActContents) ;iLine ++ )
[ ]
[ ]
[-] if(lsActContents [ iLine] != lsExpContents [iLine])
[ ]
[ ]
[ ] bFailure = TRUE
[ ]
[ ]
[ ] fncLogMsg ( "Info", "The actual value in the {sActualFileVerified} text file " )
[ ]
[ ]
[ ] fncLogMsg ( "Info",
"{lsActContents [ iLine] }" )
[ ]
[ ]
[ ] fncLogMsg ( "Info",
"The expected value in the { sExpectedFileVerified } text file ")
[ ]
[ ]
[ ] fncLogMsg ( "Info",
"{lsExpContents [ iLine] }" )
[ ]
[ ]
[ ]
[ ]

(Continued on next question...)

Other Interview Questions