question

dclaar avatar image
dclaar Suspended asked dclaar Suspended posted

response doesn't work in CallProcedure

iTest 4.1.0

 

If I do CallProcedure with [response .], noting is passed to the procedure. If I set var [response .] and then CallProcedure with $var, the response is passed.

 

main

Step Action Session Description
1
eval

puts "This is a test"
analyze
none
assert "true"
When True Details
CallProcedure return_to_sender [response .]
When False Details
2
eval

puts "This is a test"
analyze
none
assert "true"
When True Details
Eval set resp [response .]
CallProcedure return_to_sender $resp
When False Details



return_to_sender

Step Action Session Description
1
eval

puts ${arg[1]}
analyze
none
assert "true"
When True Details
DeclareExecutionIssue OK:The answer is: [response .]
PassTestIfNotAlreadyFailed
When False Details

 

Execution Issues

Index Severity Originator Message Location

info execution
Execution started

1.1.1
pass analysis
The answer is:
/procedures/1/steps/0
2.1.1
pass analysis
The answer is: This is a test
/procedures/1/steps/0
2.1.1
pass execution
Test case return_to_sender has passed.
/procedures/1/steps/0

info execution
Execution completed (0s)
iTestbug
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
EricGregMiller avatar image
EricGregMiller answered EricGregMiller posted

This looks like it's kind of the opposite of the problem discussed at Problems with lists and passing them to Procedures. It is my understanding that iTest doesn't provide command expansion in procedure calls.

 

If this is a problem for you, keep this thread going and I can investigate further.

 

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JeffJ avatar image JeffJ ♦ commented ·

The situation here is that the CallProcedure is a delayed action in the analysis rule.  That means that the call is not executed until the step/analysis is finished.  There are many reasons for this so I'll not expand on that at this time.  Since the "callProcedure" is not executed until after the step is complete, the resolution of [response .] is null as there is no response to provide.

 

However, you can accomplish what you are seeking in a couple of ways.

 

First, use an "eval" action just before the "callProcedure" action to save the response in a variable.  Then pass the variable to the "callProcedure" action.

 

The other method is to store the entire response in a variable via  "Step Properties->Other Post-processing->Store Response", then use the [response <variablename>]" to send the response to the "callProcedure".

 

If you need help in setting this up, I can provide an example of either method.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.