Two new features for the SWTActor <output> tag

The output tag on Amakihi will currently retry 10 times, with a short delay between retries, if the output it is seeking is not found.

This is great, but can cause us a problem when we want to retry because we know that we are slower but we don’t want to put a fixed-length sleep but we know it will be longer than the time for 10 retries.

Looking in the SWTActor, I found that the retry count and retry interval were hardwired, so I added two new attributes to the output tag as follows:

Attribute Default value Description
maxRetries 10 The number of times this output check will be retried before the test fails.
retryInterval 500 The delay between retries, in milliseconds

Both tags are optional; existing code will stick with 10 retries, 500ms apart.

So, in our script we can change the output tag to this:

<a:output format="sample" rules="dontStartAtTop" retryInterval="15000">
      <text controlId="foo.control">
         <text>500</text>
      </text>
</a:output>

This leaves us with a retry count of 10, but with 15 seconds between each retry attempt giving us a maximum time of 150 seconds for the application to respond – but if it responds faster we don’t have to wait for the whole 150 seconds.

It's only fair to share...
Share on FacebookGoogle+Tweet about this on TwitterShare on LinkedIn

Leave a Reply