How can i open a file using TSL (Test script language) of mercury?
I was using Winrunner to test java application. The java application stores its data in a ".log" file. It is very similar to a normal text file. The only difference is that the name of the file is "score.log". I want to open this file in TSL. There is line called "Score=120". Each time I run the java application, the java application stores the score in this log file. I want to use TSL to store the value (say 120) in a variable and compare it to the expected result. Can anybody give me a hint in the right direction? Any help would be appreciated.. Thanks in advance.
subhash, when using commands in WinRunner, it is more appropriate to use the associated constant name that corresponds to the actions you want to perform when it comes to file and ddt functions.
Telling someone to use '0' as the second paramter doesn't inform them of what it does. using FO_MODE_READ is more descriptive. Plus, it also eliminates the chance of code breaking if Mercury ever decides to update what '0'
does. Just beter programming practices all around.
Also, reading the main question, it sounds like the search criteria would be more on the 'score=' text than the 120 as I would think score would change depending on the situation.
Insanity: doing the same thing over and over again and expecting different results