Jump to content

How to continue script after loop...


Recommended Posts

Hello all,

I have an installation script with a loop which waits for a window which takes a long time to appear... there are several other windows and pop ups after this screen which need buttons clicked, etc.

The loop works great but as of now the script stops working as soon as the loop completes successfully... the script remains active but doesn't perform any of the commands after the loop. I'd like to know how to continue with the rest of the installation after the loop completes.

Any ideas or suggestions would be greatly appreciated. Please find the code starting with the loop and the rest is what it's not being performed.

;; Wait for Installation to Complete and DBConfig Window to Appear:
While 1
    ; find control (Apply button) whose Text is Apply:
    $var = ControlGetText("Advantage Utility", "DB Configuration", "[Text:Apply]")

    If $var == "Apply" Then
        ; Activate the window
        WinActivate("Advantage Utility","DB Configuration")
    
        ; Activate and Click on Apply
         Send("{TAB 10}")
         Sleep(1000)
         Send("{ENTER}")

        ExitLoop
    EndIf
    Sleep(1000)
WEnd




;; 2nd Pop-Up
WinWait("Success","Configured successfully ")
WinActivate("Success","Configured successfully ")
Sleep(1000)
Send("!Y")


;; 3rd Pop-Up
WinWait("Message","Blank Database Installation Completed")
WinActivate("Message","Blank Database Installation Completed")
Sleep(1000)
Send("{ENTER}")


;; Back to 1st Pop-Up
WinWait("Advantage Utility","DB Configuration")
WinActivate("Advantage Utility","DB Configuration")
Sleep(1000)
Send("{TAB}")
Sleep(1000)
Send("{ENTER}")


;; Final ADVANTAGE Install Screen
WinWait("Advantage - InstallShield Wizard","The InstallShield Wizard has successfully ")
WinWaitActive("Advantage - InstallShield Wizard","The InstallShield Wizard has successfully ")
Sleep(1000)
Send("{ENTER}")

Exit
Link to comment
Share on other sites

I see no reason for your script to not continue, other than the popups not being found.

I note, that you don't have an escape (timeout) from waiting for each popup to appear, which is not safe/good programming.

Does your script actually finish/exit? I'm guessing not, going by your remains active comment.

Or does it pause waiting forever for a popup? It would seem that way.

You really should add in a few If WinActive statements, and error code ... which might help you with diagnoses.

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

TheSaint: The script does not finish/exit just as you guessed but I'm not sure what exactly it's doing since it never detects the additional pop-ups/screens that come after the loop.

Appreciate the suggestions, will look into adding If WinActive statements and see where it goes from there.

Link to comment
Share on other sites

If you don't know exactly where your script is "failing", we can only speculate.

Add some error handling, and consolewrite or logging, to see exactly what is, or is not, happening.

Also, on that loop, get the actual window to appear, use the AutoIt window info tool, and post back the summary tab.  You might not be targeting it correctly.

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...