Sign in to follow this  
Followers 0
JonnySpec

Can not get button to click

6 posts in this topic

I am trying to automate a process. Below is the basic code for starting and clicking the first button" my issue is that the button does not click. I have looked at the manual (Standard RTFM first) but to no avail. any suggestions would be great . Thanks in advance.

And now the code:

run("C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\ImportWiz.exe")
$handle = WinGetHandle("[CLASS:#32770]")
WinActivate($handle)
$chandle = Controlgethandle($handle,"",12324)
WinActivate($handle)
ControlSend($handle,"",$chandle,"!n",0)
WinActivate($handle)

Share this post


Link to post
Share on other sites



Welcome to the forum !

You forget winwait before winactivate ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Still a No-Go . Button is not clicking

Updated Code:

run("C:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\ImportWiz.exe")
$handle = WinGetHandle("[CLASS:#32770]")
WinWait($handle)
WinActivate($handle)
$chandle = Controlgethandle($handle,"",12324)
ControlSend($handle,"",$chandle,"!n",0)
WinWait($handle)
WinActivate($handle)
Edited by JonnySpec

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You are still trying to get the handle, perhaps before it exists because you have WinGetHandle() BEFORE WinWait().

Also, class #32770 is a very common dialog class, and there are probably more than one open at any given time (some hidden). You need to be more specific, like:

WinWait("[CLASS:#32770; TITLE:Your Window Title Here]", "", 10) ; Wait max 10sec for window to appear
$hWin = WinGetHandle("[CLASS:#32770; TITLE:Your Window Title Here]", "")
If @error = 0 Then
     MsgBox(64, "Success", "Got window handle:  " & $hWin)
Else
     MsgBox(16, "Error", "Failed to get window handle!")
     Exit
EndIf

;)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

And for click try controlclick or controlcommand...


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

And for click try controlclick or controlcommand...

Thanks for the quick turn around.. adding the TITLE to the get handle solved the issue

Share this post


Link to post
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
Sign in to follow this  
Followers 0