I’ve been using WUKS in the context of API testing where the general work flow is as follows:
- Submit an async API transaction and receive a transaction ID
- Use WUKS and subsequentially run a query on the transaction ID’s status
- If all goes well, continue with the test.
Unfortunately, the part that WUKS has to process is rather a large one as the API itself is fairly complex. For each call to WUKS, the underlying API-specific robot code receives:
- a variable name. That entry will be extracted from the API response’s JSON opject
- a positive list and a negative list of values for that variable. Explanation see below
- additional positive and negative lists API call’s http response (e.g. 200 for http200)
Additionally, the actual async operation can take up to two hours to complete. Yes, two hours.
The WUKS result is considered to be positive/successful if:
- the variable’s value can be found in the JSON response and its value can be extracted AND
- the variable’s value is contained in the positive list AND
- the http response code’s value is contained in the positive list
The WUKS result is considered to have failed completely if:
- the variable’s value can be found in the JSON response and its value can be extracted AND
- (the variable’s value is contained in the negative list OR
- the http response code’s value is contained in the negative list)
Any other error situation is considered to be a minor error which will trigger a new WUKS cycle.
However, when the test knows that its async option has failed completely, I need to break free from the WUKS cycle and abort it. To my knowledge, I could fail the WUKS part of the test in the following two ways:
- Fail keyword. This will not help me as it will simply trigger another WUKS cycle. In case I have specified a retry interval of 120 times with a sleep cycle of one minute, my test will terminate - but only after 120 minutes.
- Fatal Error keyword. This is the option that I have chosen. The moment the test recognises that the WUKS test step has failed (and that there is no further sense in waiting until the test auto-terminates), I do trigger a Fatal Error and the test terminates. Works like a charm.
So far so good. The issue that I want to get clarification on is that the Fatal Error keyword does not only terminate the current test but ALL other tests within that same suite. So if I have a test file where the very first test case’s API fails and causes a Fatal Error, the remaining test cases of the same suite will no longer be processed.
What I’m essentially looking for is a keyword that permits me to break free from the WUKS part of my test and terminates the current test at the same time - but permits Robot to continue processing of the remaining tests in my suite. From a ‘failure severity’ perspective, is there a keyword which has a higher severity than Fail and a lower severity than Fatal Error?
Alternatively, is there a better way for breaking free from a WUKS test and have it the current test terminated in a negative manner?