|We don't bite newbies here... much|
GUITest to test GUIby Anonymous Monk
|on May 17, 2004 at 11:30 UTC||Need Help??|
Anonymous Monk has asked for the
wisdom of the Perl Monks concerning the following question:
I need your help and guidance please,....
I am using ‘system()’ on WinXP to run list of batch files – that installs software - and using GUITest to check if the execution of those batch files were successful, like so;
Only if the execution of this batch file was unsuccessful, then a popup window appears indicating the failure, otherwise no popup windows will appear. Also, those popups do not remain on the screen, they have a time out value of few seconds and they disappear soon after.
Basically, I am trying to detect those pop ups using this bit of code which I test and it works fine,
However my problem is this, If I insert the above GUItest code after the System( ) command, then it will only run after System() has completed its excution and by then if there were any popups, then they would have disappeared.
A suggestion was made is to exit system() after starting the batch file and then running the above code. But will not help because there is no telling when these popups will appear – it could happen as soon as the batch file has ran or after few seconds. And importantly one batch file must complete its execution before starting another.
Oh, some of those batch file will attemp to restart the local machine so I need to prevent that.
What I need to do is to have the above GUITestcode running in tandem with the system ($batch) command. i.e. as the system() begins running a batch file from the list then the GUItest should start monitoring for any popup connected to that particular batch file. and Only move on to the next batch file in the list when the running of the current batch file has completed or a popup was detected.
I am not sure how I can achieve this! Do I need to use multi threading? Can I get system() to run to processes concurrently? Alternatively, how can I exit off the while loop once the batch file has completed its run?
Can some one please help me out here....That wil be very highly appreaciated,....Indeed.
Thank you very much in advance.