Help identifying windows which aren't cooperating

Started by jerwah, March 27, 2015, 01:33:22 PM

Previous topic - Next topic

jerwah

I am trying to write some automation for a process which interacts with an ancient program written in Powerbuilder.

What pops up on the screen appears to be normal titled windows..

Example window says "Employee Selection" in the title bar.
However when I use WinInfo it says the Window Title is: "Frame".  Every window in the program, regardless of what is printed in the title bar comes up "Frame"

Is there a different way to interrogate the title bar and see what's "Actually" there?

I tried running through roboscripter... and it comes up like this:

window1=cWndByWndSpecName("Frame","program",2,2000,0)


But the problem is, other windows in the application, are ALSO "Frame", even though they ACTUALLY say something different in the title bar.


Thanks in advance.


td

A window's title is not necessarily the text in the title bar although that is what MSFT intended.  If the cWndByWndSpecName function is grabbing the window you want, why not just us it?  The idea behind the function is to make it possible to correctly identify a window even those it shares a its name with other windows.

If cWndByWndSpecName is not working you could try cWndByWndSpec or cWndByClass.  You can use the Analysis.wbt script in the WinBatch samples folder to get the window's class name.

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

jerwah

Thanks, I've tried analysis too.  It seems like under the covers they're displaying the exact same controls over and over again and changing the contextual prompt text, but I've been completely stymied trying to figure out that text.

So for example there is an input control which prompts
Enter ID: [    ]
and after you enter the ID and press enter it changes to
Enter CODE: [    ]

As far as I can tell, roboscripter and analysis, they're both
id:1002
class: PBEDIT050
windows state: 2
title: ""

The actual TEXT that's displayed to the left of the input box comes up as a button??
id: 1004
class: Button11
windows state: 2
title: ""

But for the purposes of my automation it would be important for me to know which prompt was up on the screen.




jerwah

Ok, so going back to analysis.csv gave me a way to do this.  It's ugly but works.

I took an analysis.csv on screen 1 and another one on screen 2 and ran a diff against them.  There are a couple of very minor differences between the 2 ( mainly in the WndStyle column ). Instead of trying to target the information specifically, I took the guts of analysis and made it as a function inside my script.

I can now call it and get the analysis.csv (in memory), I compare that to several "fingerprint" csv files that I load at the start of the script. Klunky, but gets the job done.

Thanks for making me thing about analysis script again