Jump to content

Can't get WinActivate to move on to the next step. Also, AdLibRegister, Am I doing it right?


Recommended Posts

We use a program called Host on Demand to handle some stuff, but installing it is a flurry of popups and it seems like AutoIT should be able to get the job done, I'm working through the script right now and have run into a speed bump. When the IE window opens you are presented with one of two popups, either the "Message from webpage" or the "Warning - Security" popup.

"Warning - Security" always appears, and if you click through it fast enough you shouldn't see the "Message from webpage" popup, but its erratic and it sometimes shows up anyway. After some reading it sounds like AdLibRegister might be useful for this kind of intermittent error prompt. I think I'm setting it up correctly but at the moment it just hangs on WinActivate for the "Message from Webpage" prompt. During this it behaves as if it were activating the window but it never seems to step on to the ControlClick operation that follows.

Along with all of this, is this the correct usage of AdLibReg? Is there a better way to do it? It sounds like something that runs in the background and checks every so often while the script is running for the criteria mentioned in its function, I don't feel like its actually doing that though.

Func InstallerAppletError()
   If WinExists("Message from webpage","If you are reading this message, your client platform is not capable of running IBM Host On-Demand.") Then
 WinActivate("Message from webpage","If you are reading this message, your client platform is not capable of running IBM Host On-Demand.")
 ControlClick("Message from webpage","If you are reading this message, your client platform is not capable of running IBM Host On-Demand.","",2)
   EndIf
EndFunc

;ShellExecute("http://srchodnwh002.us.src.lan/hod/")

AdLibRegister ("InstallerAppletError")

sleep(1000) ;Waiting for the AdLibReg to kick in, dont know if this actually helps though.
$uWhndIE = WinWait("Warning - Security")
WinWaitActive($uWhndIE)
ControlSend($uWhndIE,"","","{SPACE}{TAB}{ENTER}")


sleep(1000) ;;Waiting for the AdLibReg to kick in, dont know if this actually helps though.

;managing more stuff, eventually I'll fix this but for now its just a spacer to show where I'm putting stuff
;WinWait("Message from webpage","The cached client will now be installed.")
;WinWaitActive("Message from webpage","The cached client will now be installed.")
;ControlClick("Message from webpage","The cached client will now be installed.")

AdlibUnRegister("InstallerAppletError")

Exit
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...