Jump to content

Ticking checkboxes with specific names.


YMJEF
 Share

Go to solution Solved by abberration,

Recommended Posts

Hey all, 

I'm new to AutoIT and I've been playing around with it for a little bit, though I still can't fully wrap my head around how I'm supposed to achieve my goal.

The solution will be integrated through Ansible. Letting Ansible talk to AutoIT is simple enough, so that can be disregarded.

The program I'm trying to deploy needs to automatically tick the two checkboxes outlined in red followed by hitting the "Register" button (Screen1). Once this is done another window will pop up where one has to click the confirm button (Screen2).

I would like to have all of this automated so that I can integrate it in my Ansible solution so that all of this can be performed automatically. What is the best course of action? Are there perhaps any resources for me to look at in order to achieve this?

 

Thanks in advance!

Screen1.png

Screen2.png

Link to comment
Share on other sites

First of all, you need to know if the controls are accessible with standard Window (see Au3Info.exe) or UIAutomation (see UIASpy.au3).  Start using Au3Info tool located at the root of the AutoIt folder.  Report here the result of one of the controls.

 

Edited by Nine
Link to comment
Share on other sites

On 10/31/2022 at 5:03 PM, Nine said:

First of all, you need to know if the controls are accessible with standard Window (see Au3Info.exe) or UIAutomation (see UIASpy.au3).  Start using Au3Info tool located at the root of the AutoIt folder.  Report here the result of one of the controls.

 

Hey Nine,

 

Sorry for the late reply! Here's what the AutoIt3 window reports. 

 

The controls that I want to modify are all buttons and the instances are "2" "3" and "6"

Screen3.png

Link to comment
Share on other sites

As you can see you have handle and id of your controls, so you should be able to manipulate them.  In help file see ControlS functions under Window Management.  There is also a large number of functions in the User Define Functions Reference / GUI Reference / GuiButton Management.

Try of few of those functions, return back your script if you need help.

Link to comment
Share on other sites

Hey Nine,

I've tried using ControlClick in order to perform what I'm trying to do. This seemed to work initially as it parsed all the commands, but it tried clicking in the centre of the Control resource. I then tried to add some modifiers such as button and position to click, but it threw a subscript error at me.

The script below is what I've tried to run. 

; Run BLANK
Run ("BLANK.exe")

WinWaitActive ("BLANK")
ControlClick("BLANK", "", "1024" [, button = "left" [, clicks = 1 [, x7 [, y6)]]]] )

WinWaitActive ("BLANK")
ControlClick("BLANK", "", "1022" [, button = "left" [, clicks = 1 [, x7 [, y6)]]]] )

WinWaitActive ("BLANK")
Send("{Enter}")

WinWaitActive ("Confirm")
Send("{Enter}")

Screen5.png

Link to comment
Share on other sites

  • Solution

Hi, I'm assuming that you are blanking out portions of your screenshots because you think they may compromise your security. Not knowing what application you are trying to install, and it does not appear that you are trying to do anything malicious, I can offer what I think would click the register button for you. 

In the following code, replace "BLANK" with what the AutoIt Window Info's title box says.

ControlClick ("BLANK", "Whitelist Creation", "[CLASS:Button; INSTANCE:2]")

If this works, you should be able to figure out the rest for yourself.

Link to comment
Share on other sites

10 hours ago, abberration said:

Hi, I'm assuming that you are blanking out portions of your screenshots because you think they may compromise your security. Not knowing what application you are trying to install, and it does not appear that you are trying to do anything malicious, I can offer what I think would click the register button for you. 

In the following code, replace "BLANK" with what the AutoIt Window Info's title box says.

ControlClick ("BLANK", "Whitelist Creation", "[CLASS:Button; INSTANCE:2]")

If this works, you should be able to figure out the rest for yourself.

Cheers, this worked! I had already figured out a jerry rigged solution by using commands such as Send + and Send DOWN to navigate through the menu, but this is a lot cleaner. Replacing the Instance number with the target instance number for the other buttons does the trick.

 

 

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