I have a strange problem with testCase execution.
I have a test case with the following structure:
Setup script:
set session_id = 0
set session_index = 0
store custom properties in an external file
and the test case body
Test Case:
data source
SOAP - authentication on components (gives session_id for each component)
groovy - recover useful data (store session_id in custom prop session_id_<session_index>)
source loop
SOAP - start asynchronous service on component 1
SOAP - check status on component 1
goto 'check status' while status = Pending
SOAP - check status on component 2
goto 'disconnect terminals' is session_id = 0
SOAP disconnect
groovy disconnect terminal : loop for each session_index: set session_id = session_id_<session_index> and use it in the SOAP disconnect step (I use run test step)
TearDown Script : restore the custom properties
All of these steps execute with success, I don't have any error logged but the overall test has a FAILED status.
I realized that the problem comes from the goto steps: I'm looping back onto the SOAP request to check status WHILE the status returned is set to 'pending'. So each time the request returns 'pending' it's failing and I send the checking request again. When the status is finally 'success', the testStep becomes green (OK) and the testCase continues.
In the overall result, the testStep which is played several times is stored once for each 'iteration' and it's result is OK only for the last occurrence, so the overall test status is FAILED.