Wait Loop for Batch Job Execution on Command Prompt
Tosca version 10.0
In my application, I have multiple batch job execution that should get invoked one after the other in a sequence and the time taken by each batch job execution varies. In one such scenario where I have a step which has execution of 3 batches, the first takes about 10-15 seconds to comlete, 2nd takes about 1.5 - 2 minutes and 3rd takes about 20--25 seconds. Each should start only after completion of the previous. Earlier, the team who were working on the script had added a static wait time of 80 seconds after each batch job invoke which I wanted to change and make it dynamic wait. I introduced a wait loop (While Loop) and added a condition using Window Operation - Caption *cmd.exe*, Operation - Verify Window Exists and in the loop, Window Operation module -- Caption - *cmd.exe*, operation - Wait On Close. This loop will run until the window exists and exit on completion of the batch on command prompt.
From the Tosca Documentation, I see Verify Window Exists is no longer a valid property in 10.0 and was used in earlier versions. Is there any other option that I could use to verify?
The Wait On Close has a default Synchronization value of 40seconds and due to this, if command prompt doesnt close within the first cycle, the end result of Wait on Close appears as failed while it does set to Passed in the while loop 3 or 4 in which ever cycle, the cmd.exe closes post execution.
To me as a user the end result of the test case is pass but to a business user who will see the execution in Tosca, the result is failed, is there any other approach that I could take here to put a dynamic wait?