Jump to content

Know automation ID, but not control ID, how to go about automating a button click?


Zein
 Share

Recommended Posts

I've already read FAQ 31, I've tried all of junkew's examples and none of them work on my computer. Anytime I run any test script or even the spy application I get stuff like "redefining constant" or "using variable while undeclared". Dunno if running as admin affects it, but I'm not able to do that on this computer either way.

I just want to know the most straightforward way to automate a button click if I can find the automation ID of it.

I tried using jdelaney's spy tool and it didn't give me control info (as far as I can tell). Unless two separate buttons can have the same Control ID?

This is what the jdelaney's spy tool gives me if it's important.

Spoiler

Id: PrimaryButton
Text: System.Windows.Controls.Grid
Class: TButton
Native handle: 0
Bounding box: 838, 672, 120, 60

Id: PrimaryButton
Text: System.Windows.Controls.Grid
Class: TButton
Native handle: 0
Bounding box: 1006, 672, 120, 60

Two separate buttons.

 

Link to comment
Share on other sites

What was the output of my script on your window?  controls can have the same id.

 

I'm going to upload a function tonight that effectively returns acollection of controls based on several criteria, such as enabled, visible, text, id, class

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Lol. Junkew rules. They probably don’t work for you, with the examples that is, because he is looking for non English titles and I had to change to English before mine worked. 

One thing I’ve learned if @junkewsamples don’t work it’s usually my fault. Lol

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Which windows version are you using? Simplespy or uiautomation in general works without admin rights all that can happen is certain values are not exposed. 

It seems to be a delphi app button which in general should be straight forward to click on. 

Did you use latest versions of autoit and simplespy?

Link to comment
Share on other sites

On 8/9/2018 at 11:54 PM, junkew said:

Which windows version are you using? Simplespy or uiautomation in general works without admin rights all that can happen is certain values are not exposed. 

It seems to be a delphi app button which in general should be straight forward to click on. 

Did you use latest versions of autoit and simplespy?

Sorry for the late reply, I couldn't get spy to work at all on Windows 10. I turn off the Require Admin thing and the script just don't run. I found a workaround of course though, but it didnt fix any of the samples for me. 
 

On 8/9/2018 at 3:51 PM, Earthshine said:

Lol. Junkew rules. They probably don’t work for you, with the examples that is, because he is looking for non English titles and I had to change to English before mine worked. 

One thing I’ve learned if @junkewsamples don’t work it’s usually my fault. Lol

Oh, this might be it. I'll check.

Edited by Zein
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...