Jump to content

Interacting with controls, Need to use only Text


Recommended Posts

Hi folks

I have been working on a UI based automation framework for a while.

I use something like

ControlClick("MyApp","Multiple","[CLASS:WindowsForms10.BUTTON.app.0.378734a; INSTANCE:5]")
to interact with the controls.

All of a sudden I realized that a lot of my old code wasn't working. after some poking around I realized that the instance numbers for several controls have changed. So using instance number is not a reliable way for me to interact with a control.

The problems are:

1. Class is same as ClassnameNN.

2. While Class remains constant, the Instance for some controls change every time I start my app.

3. The ID for the control also changes of each restart. Same for Handle.

4. there are several similar controls in a screen with the same class and ClassnameNN, differing only in their instance numbers.

5. Other than the Text, pretty much every control entity feels unreliable now.

I am, as far as I know, am left with two choices;

i. Use the Text which remains constant.

It would be best to use just text but I can't get it to work. I also can't get Class/Text or Classname/text to work either.

ControlClick("MyApp","Multiple","[ClassnameNN:WindowsForms10.BUTTON.app.0.378734a; Text:Multiple]")

doesn't works.

ii. or use regular expressions.

Something I have zero idea of.

maybe something like

Controlclick("MyApp","Multiple","[ClassnameNN:</whichever>; Text:Multiple]"; Instance:</whichever>)

thanks and regards

Rishav

EDIT: I played around a bit with RanorexSpy (similar to AutoIt windows info) and i found another control entity;

Control Name: rbMultiple

Can i use this somehow?

UPDATE: Ok this thread looks promising. Hopefully, this will work.

http://www.autoitscript.com/forum/index.ph...mp;#entry572806

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