|
Description
Correcting errors that are caused by creating a transaction then immediately trying to query that item.
Solution
We had run into problems with scripts that created transaction such as purchase order, and then immediately did something with that transaction such as posting a goods receipt. Our test environment had not fully processed the newly created transaction prior to trying to update it. We would get an error that said "document XXXXX doesn't exist" even though we just saw it get saved and we output the document number. If we went to the SAP screen and hit enter manually, the document number was accepted. We realized that we were trying to use that document too quickly after it was created. The first solution we tried was changing the testcase settings to allow a longer minimum think time for the script. This solution just slowed the entire script down and was not entirely satisfying. Looking at it further, we realized that we could either wait a little longer to hit enter, or we could just hit enter repeatedly until the system recognized the document number as existing, and displayed the next screen. You can use a GUI object loop to repeat this step until the next screen appears, but by far the easiest way to handle this is to use the step properties for that 'Enter' or 'Post' command. Within Properties is a tab called "Retry". The Retry tab has two settings, Retry and Delay. The Retry parameter indicates how many times the script should retry this step before failing. The delay indicates how many seconds to wait between each retry. By changing the Retry setting to 5, and the Delay setting to 1 second, we were able to solve our timing problem. |
|