Sign in to follow this  
Followers 0
mim

Newbie: Advice needed on scripts to click buttons and select check boxes

13 posts in this topic

Hi all,

I would like to use autoit to be able to install an application.

I am trying to use the ControlClick command for clicking the "next" button or for selecting a checkbox and i am using the ControlSend command to enter text in a text box. I have tried using ID as a parameter, however, it seems the ID changes next time i try and run my script. Also i have tried using CLASSNN as a parameter, but it also seems this changes next time i run the script.

Could you please advise me on what is the best approach to this problem?

Thanks in advance.

Share this post


Link to post
Share on other sites



Hi, Mim. Welcome to the forum. What is the product you're trying to install? It is quite often (99%) easier to script a silent install rather than attempting to script your way through all of the windows to select the options you would like. Depending on the product, there are a couple of ways to go about it, but if you can give us an idea of what you're trying to install we can gladly assist. :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

I've had to do several automated installations for my work and I've found that http://www.appdeploy.com is a great place to start.

You may find that the software you are trying to automate has already been done and members have posted what they used to automate it.

Other places to look on their site:

MSI installations: http://www.appdeploy.com/articles/commandline.asp

InstallShield installations: http://www.appdeploy.com/tips/detail.asp?id=18


If you try to fail and succeed which have you done?AutoIt Forum Search

Share this post


Link to post
Share on other sites

Hi guys,

Thanks for the replies...much appreciated.

So the product i need to install is an propriety product we produce at work and my aim is to automate installation of it for testing purposes.

After searching around, i found that i could use the "Send("!n")" command on most of my screens. However i have 1 window that pops up with a OK button which i dunno how to click.

I have tried the following:

ControlClick("Ack Screen", "", "[CLASS:Button; TEXT:OK; INSTANCE:1]")

but with no luck...could it be cos this is maybe like a jsp popup?

Regards,

Share this post


Link to post
Share on other sites

Hi, Mim. Can you please use the AutoIT Window Info tool on that particular pop-up, and then post what you get as a result?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Hi JLogan,

Below is what i get using the Window Info tool:

Regards

Edited by mim

Share this post


Link to post
Share on other sites

I cant seem to see the screenshot i pasted earlier...how do i add an attachment?

Share this post


Link to post
Share on other sites

In the Control Tab i see the following:

Class Button

Instance 1

ClassnameNN Button1

Name

Advanced Mode [CLASS:Button; INSTANCE:1]

ID 525258

Text OK

Position 215, 75

Size 76, 23

ControlClickCoords 15, 17

Style 0x54010301

ExStyle 0x00100000

Handle 0x00000000000803CA

Regards,

Share this post


Link to post
Share on other sites

Hi, Mim. Have you attempted your ControlClick, removing either the TEXT or INSTANCE designation?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

No i have not.

Share this post


Link to post
Share on other sites

mim

I prefer, wherever possible, to use a Send() command, as it isn't then subject to screen resolution

Try:

Use the Window info tool (in SciTE ctrl+F6) to identify the window name and text, then use

WinWait("windowname", "windowtext")
WinActivate("windowname", "text")
Send("{TAB n}") ;  n= however many you need to get to the OK button
Send("{SPACE}")

I have used this many times for software installs


[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites

Hi Shornw, Thanks for the reply...seems like an interesting way to do it.. will try it. Regards,

Share this post


Link to post
Share on other sites

So what i did was just use WinActivate and then ControlClick and it worked.

Thanks.

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