Sign in to follow this  
Followers 0
Rishav

Interacting with controls, Need to use only Text

1 post in this topic

#1 ·  Posted (edited)

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

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