Sign in to follow this  
Followers 0
Rawling

CLASS:WindowsForms ...

7 posts in this topic

Hi,

I've been automating a set of test for an application, and have had to access an object by its class, which for me is reliably [CLASS:WindowsForms10.window.20808.app.0.218f99c] across builds, different machines etc.

However, for my boss, the class is [CLASS:WindowsForms10.window.808.app.0.218f99c], and presumably it'll be different for whoever's running the test.

Can anyone point me in the direction of documentation about where these class identifiers come from, so I can try to come up with a better way of predicting what this value needs to be than having the user fire up an inspector and find it for themselves?

Cheers.

Share this post


Link to post
Share on other sites



I don't know why they are different, but you can use WinGetClassList th find the classes. You can also select a Control via the Coordinates instead of the ClassNameNN.


Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

I don't know why they are different, but you can use WinGetClassList th find the classes. You can also select a Control via the Coordinates instead of the ClassNameNN.

Unfortunately the objeect I'm accessing is some system window used as a parent for popup menus - I can't access it by name and text, only by this [CLASS].

Share this post


Link to post
Share on other sites

Well, a bit more googling leads me to this page, which suggests the part in question is the window style. (Although that doesn't quite match as the article doesn't mention a period between "app" and the app domain.)

Which leads me to this page which, combined with looking up those values in VS, leads me to belive that my window has "OptimizedDoubleBuffer" set while my boss's doesn't. I'm not convinced as the trailing 8 doesn't seem to have a corresponding flag. The first 8 is "SupportsTransparentBackColor".

Share this post


Link to post
Share on other sites

Rawling,

Looking at the Window Titles and Text (Advanced) page in the Help file, I noticed that you can use Regular Expressions to ID windows by class:

e.g. List windows matching a classname defined by a regular expression

WinList("[REGEXPCLASS:#\d+]")

A suitable SRE would be:

(?i)(WindowsForms10\.window\..*\.app\.0\.218f99c)

which matches both of your window class names. So perhaps you could try:

"[REGEXPCLASS:(?i)(WindowsForms10\.window\..*\.app\.0\.218f99c)]"

I hope this helps. ;)

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Rawling,

Looking at the Window Titles and Text (Advanced) page in the Help file, I noticed that you can use Regular Expressions to ID windows by class:

A suitable SRE would be:

(?i)(WindowsForms10\.window\..*\.app\.0\.218f99c)

which matches both of your window class names. So perhaps you could try:

"[REGEXPCLASS:(?i)(WindowsForms10\.window\..*\.app\.0\.218f99c)]"

I hope this helps. :evil:

M23

That seems to be working, although I'm having to tweak it to avoid hitting an annoyingly-similarly-named window instead of the correct one.

Cheers ;)

Share this post


Link to post
Share on other sites

Rawling,

It is never simple, is it? ;)

Glad I could help.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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