Last Operation Result returns blank
I have a master VBA script that loops through a spreadsheet header row to get the name of the keyword script that I want to run next, then feeds that name from the header as a variable to run that script. I am now trying to get the result of that keyword test, pass, warning or fail, and write that back to the spreadsheet in the row below the header. I know how to write back to the spreadsheet but what I have a problem with is getting a value for the result, it is always returning blank so it always goes to the else even though the keyword test passed.
I have tried the following that I found in other topics, but always blank. Is there something I am missing?
LastResult = Eval("KeywordTests." + testCaseName + ".Run")
If (LastResult = True) Then
Call Log.Message("Pass", "")
Call Log.Message("Fail", "")
If Eval("KeywordTests." + testCaseName + ".Run") Then
Log.Message "Test returned True"
Log.Message "Test returned False"
I have also tried this through just a simple keyword test, but still returns blank.
I have a feeling after reading this https://support.smartbear.com/viewarticle/67975/ that you might have to do that.
It says, 'The Return operation sets the result value of the keyword test and then exits the test.'
Carrying djadhav's response one step further, This link https://support.smartbear.com/viewarticle/70647/ states the following:
"To return a value from a keyword test, you can use the Return operation. You typically add this operation at the end of the test, because it immediately exits the test. Tests without the Return operation have no return value."
Since there is no return value from the called test without setting the Return operation, the last operation result is blank and is logged as such.