ankit.tayal560 has asked for the wisdom of the Perl Monks concerning the following question:
Master Script: use strict; use warnings; my $cmd1="C:/ProgramData/Microsoft/Windows/Start Menu/Programs/Accesso +ries/Calculator.lnk"; my $generatorDir = "c:/perl/perl_tests"; my @rprtname = ("gui_calci"); my $rpcount=0; foreach(@rprtname) { my $rptscript = $rprtname[$rpcount]; system ("perl $generatorDir/$rptscript.pl")and die"error running $rpts +cript.pl $?" ; $rpcount++ }
gui_calci Script: use Win32::GuiTest qw(:ALL); use strict; system($cmd1); my @window=FindWindowLike(undef,"Calculator"); if(!@window) { die("cannot find window with title/caption Calculator\n"); } else { printf("window handle of Calculaotr is %x \n",$window[0]); } EnableWindow($window[0],1); PushChildButton($window[0],132); sleep 2; PushChildButton($window[0],93); sleep 2; PushChildButton($window[0],135); sleep 2; PushChildButton($window[0],121); sleep 2;
When I try to pass file path of calculator in master file itself my script does not work while when I pass it in gui_calci script it works fine. how can I pass file paths in the master script itself???
|
---|