Jump to content

Clicking a button by its class


Recommended Posts

Hi,

I have a popup window which appears during my automation run which needs to be closed. The 'OK' button on the popup needs to be clicked in order to close it.

I've used the AutoIT Windows tool to gather the information I need to click this button, I have it's ID, text, and class. I cannot use the text as this popup will appear localized in some languages. The ID of the button appears as '100'

I have tried clicking the 'OK' button like this:

WinActivate("Alert Window")
ControlClick("Alert Window", "", "100")

But it does not work. Is there any way I can click the button by using its class?

Thanks

Link to comment
Share on other sites

why not use "Send("!o")" for the keyboard shortcut to the ok button?

[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

Link to comment
Share on other sites

try "[CLASS:100]" instead of "100" in ControlClick("Alert Window", "", "100")

[size="2"] "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian Kernighan[/size]

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