How can I compare two values in TC while recording a script.
Look at creating a checkpoint
you can use checkpoints as Eric indicated, or after you finished recording it you can debug the script and compare values as well, use WatchList or Local variabels window to see what results you get.
Also, I recommend that you see the "Comparing and Finding Images" help topic.
David - SmartBear Support