Forum Discussion
Maybe I don't understand exactly what both of you are asking, or I wasn't clear above but hopefully I can answer.
djadhav - In the testSuiteRun Sub code above, I included basically the code that is in the "Using the Return Operation" section in the link you included in your post. It is represented in this code:
If Eval("KeywordTests." + testCaseName + ".Run") Then
sheet.Cells(r, c) = "P"
Else
sheet.Cells(r, c) = "F"
End If
After it plays the script on the If Eval("KeywordTests." + testCaseName + ".Run") Then line, it jumps to the Else step.
I don't know if that is what you mean by "Did you include the Return Option.." or not, or is there something else I need to do? If so where would it fit into the testSuiteRun sub script above?
joseph_michaud and djadhav - Above is also the script, Test_Run_JG(), that I did in fact try to log the return value, and it returns nothing, it is blank, no True or False, nothing.
Here are screenshots again of just a keyword script that I had also tried before posting with calling another keyword script, then logging Last Operation Results. Again, nothing.
I apologize if I was not very clear. That code would not go in the testSuiteRun.
Here is an example of what I am asking:
Your code Eval("KeywordTests." + testCaseName + ".Run") calls a piece of code referred to by the 'testCaseName'. That piece of code should have a return statement in the end.
e.g. Let's say testCaseName is Login from the Excel file. So you will call Eval("KeywordTests.Login.Run"). I need to see Login module that is being executed here because that is where the return statement would go.
Hope this helps
- dmiscannon9 years agoFrequent Contributor
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.
- jgoetz9 years agoOccasional Contributor
Ok i don't see that mentioned in what I have read. The script being called is a keyword test script, not a VBA script, it is looks like this.
From what I read here, https://support.smartbear.com/viewarticle/74736/ the Last Operation Result should carry over to the script/keyword that it is called from without adding anything to the keyword that is called. Or maybe I miss it.
I would prefer not to have update all of the 50 some keyword tests that we already have being called if that is possible.
- djadhav9 years agoRegular Contributor
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.'
- jgoetz9 years agoOccasional Contributor
Ok thanks. I will give this a try if I can't find a way to not have to update the scripts being called.
Related Content
Recent Discussions
- 2 days agoGane195