vrocco Posted May 25, 2007 Share Posted May 25, 2007 (edited) I am trying to automate an install program. I want it to click through the "Next, Next, Finish" setup program. However, the windows don't always appear at the same interval depending on the computer speed. I tried the code below, but it did not work at all. Can someone help me out? Opt("WinTitleMatchMode", 1) Run("snpvw.exe") Do Sleep(1000) Until WinExists("Snapshot Viewer", "Would you like to install the snapshot viewer?") ControlClick("Snapshot Viewer", "Would you like to install the snapshot viewer?", 1) Do Sleep(1000) Until WinExists("Snapshot Viewer", "Please read the following license agreement.") ControlClick("Snapshot Viewer", "Please read the following license agreement.", 6) Do Sleep(1000) Until WinExists("Snapshot Viewer Setup", "Welcome to the Snapshot Viewer installation program.") ControlClick("Snapshot Viewer Setup", "Welcome to the Snapshot Viewer installation program.", 8) Do Sleep(1000) Until WinExists("Snapshot Viewer Setup", "Setup will install Snapshot Viewer in the following destination folder.") ControlClick("Snapshot Viewer Setup", "Setup will install Snapshot Viewer in the following destination folder.", 1) Do Sleep(1000) Until WinExists("Snapshot Viewer Setup", "To start installation, click the large button") ControlClick("Snapshot Viewer Setup", "To start installation, click the large button", 14) Do Sleep(1000) Until WinExists("Snapshot Viewer Setup", "Snapshot Viewer Setup was completed successfully.") ControlClick("Snapshot Viewer Setup", "Snapshot Viewer Setup was completed successfully.", 1) Thanks in advance! Vito Edited May 25, 2007 by vrocco Link to comment Share on other sites More sharing options...
enaiman Posted May 25, 2007 Share Posted May 25, 2007 Your script should work. The only problem could be if you got correctly the ControlID s. Anyway it would be a good idea to add the line AutoItSetOption ("TrayIconDebug", 1) on top of your script and see where is hanging up. SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
vrocco Posted May 25, 2007 Author Share Posted May 25, 2007 (edited) Your script should work. The only problem could be if you got correctly the ControlID s. Anyway it would be a good idea to add the line AutoItSetOption ("TrayIconDebug", 1) on top of your script and see where is hanging up. Thanks for the reply. It hangs up on Line 6 which is the first "Sleep (1000)". Never moves from that even though the window it should be looking for is clearly on the screen. With regard to the ControlID, I used the Autoit Window utility to find them. Any other ideas? Vito Edited May 25, 2007 by vrocco Link to comment Share on other sites More sharing options...
enaiman Posted May 25, 2007 Share Posted May 25, 2007 (edited) Try to use WinWaitActive("Snapshot Viewer", "Would you like to install the snapshot viewer?") ControlClick("Snapshot Viewer", "Would you like to install the snapshot viewer?", 1) ;instead of Do Sleep(1000) Until WinExists("Snapshot Viewer", "Would you like to install the snapshot viewer?") ControlClick("Snapshot Viewer", "Would you like to install the snapshot viewer?", 1) Edited May 25, 2007 by enaiman SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
vrocco Posted May 25, 2007 Author Share Posted May 25, 2007 Try to use WinWaitActive("Snapshot Viewer", "Would you like to install the snapshot viewer?") ControlClick("Snapshot Viewer", "Would you like to install the snapshot viewer?", 1) ;instead of Do Sleep(1000) Until WinExists("Snapshot Viewer", "Would you like to install the snapshot viewer?") ControlClick("Snapshot Viewer", "Would you like to install the snapshot viewer?", 1) OK I tried that and the debugger hung on that line of code you gave me. Wouldn't go past that point. And yes, I did also check to make sure the window title was correct. I'm stumped.... Link to comment Share on other sites More sharing options...
enaiman Posted May 25, 2007 Share Posted May 25, 2007 OK - i've tested it and you will need to change Opt("WinTitleMatchMode", 2)oÝ÷ Ù©Ýj[(¶¬zz-¶°^¶+e{û^ÆÖî¶È 'âq©í¥ªí²X¤y«¢+Ù¼(M±À ÄÀÀÀ¤(U¹Ñ¥°]¥¹á¥ÍÑÌ ÅÕ½ÐíM¹ÁÍ¡½ÐÅÕ½Ðì°ÅÕ½Ðí±¥Ñ¼¥¹Íѱ°ÅÕ½Ðì¤( ½¹Ñɽ± ±¥¬ ÅÕ½ÐíM¹ÁÍ¡½ÐÅÕ½Ðì°ÅÕ½Ðí±¥Ñ¼¥¹Íѱ°ÅÕ½Ðì°Ø¤ And you did have got the ControlID wrong (at least for the first window - it is 6 not 1) SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script wannabe "Unbeatable" Tic-Tac-Toe Paper-Scissor-Rock ... try to beat it anyway :) Link to comment Share on other sites More sharing options...
vrocco Posted May 25, 2007 Author Share Posted May 25, 2007 OK - i've tested it and you will need to change Opt("WinTitleMatchMode", 2)oÝ÷ Ù©Ýj[(¶¬zz-¶°^¶+e{û^ÆÖî¶È 'âq©í¥ªí²X¤y«¢+Ù¼(M±À ÄÀÀÀ¤(U¹Ñ¥°]¥¹á¥ÍÑÌ ÅÕ½ÐíM¹ÁÍ¡½ÐÅÕ½Ðì°ÅÕ½Ðí±¥Ñ¼¥¹Íѱ°ÅÕ½Ðì¤( ½¹Ñɽ± ±¥¬ ÅÕ½ÐíM¹ÁÍ¡½ÐÅÕ½Ðì°ÅÕ½Ðí±¥Ñ¼¥¹Íѱ°ÅÕ½Ðì°Ø¤ And you did have got the ControlID wrong (at least for the first window - it is 6 not 1) Like a charm!!! I don't know how I got that first ContolID wrong. The rest were ok. Thanks for your help! You rock! Vito Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now