GuiTest - scraping the content of dropdown in Jave app?

W

Woland99

Hi - I am trying to use Perl to run a simple test scrip on Java app. I
need to run same testcase for ALL the items on one of the dropdown
controls. Problem is - content of that control ie. item on that
dropdown list may change from build to build and there is a LOT of
them 50+ so not feasible to simply copy them by hand.
Is there any way to use Perl to extract content of such control?
I tried GuiTest module - it does ok job in controlling the pp although
it does not seem to see any child windows on it - just the main one -
of class SunAwtFrame - I can do SenKeys and it is sufficient to run
the test but I really need to enumerate results by the content of that
control. Perhaps there is another tool better suited for the task of
running Java app?

TIA for any pointers/references/hel,

JT
 
W

Woland99

Is the Java app using AWT or Swing? (I presume you're not talking about
something web-based, which would be much easier to test.) If it's Swing
you probably can't get at the contents at all: Swing does its own
drawing, so as far as the OS knows there's nothing there but coloured
pixels. If it's AWT then I thought AWT used real OS controls, but ICBW.

When you say 'GuiTest' do you mean Win32::GuiTest or X11::GUITest (or
something else)? Win32::GuiTest has a GetComboContents function, *if*
you're talking about a real (Win32) combo box and you can find its hWnd.
If you aren't or you can't you're probably out of luck.

Since you're writing tests for this app, is it reasonable to assume you
can also modify it? If so, you can get the app to write the list to a
file somewhere.

Ben

Thanks for reply Ben,
As I said WinSpy sees that Java app as single object of class
SunAwtFrame.

Technically yes I could get access to Java source code but that app
is
written and maintained by entirely diff group in our organization and
that would require going through million hoops.

Yes Win32:GuiTest and I can't seem to get handle to combo box - but
thanks
for that pointer.

JT
 
W

Woland99

Quoth Woland99 <[email protected]>:











If there aren't any OS-level windows there then the app must be using
Swing or something else like it that does its own drawing. In that case
your only real options are either getting the source to the app or
running it against a patched version of javax.swing (or whatever it
actually uses), at which point this becomes definitely not a Perl
problem.

Ben

Hmmm - it will be super ugly but I think I can grab a shot of the app
win every time I make a selection, crop it and run it thru some
freebie OCR (all using GuiTest) - it will be slow but will suffice
until I can connect with that app team and persuade them to change
their code. Thanks, Ben.
 
Joined
Oct 2, 2017
Messages
1
Reaction score
0
> Is the Java app using AWT or Swing? (I presume you're not talking about
> something web-based, which would be much easier to test.) If it's Swing
> you probably can't get at the contents at all: Swing does its own
> drawing, so as far as the OS knows there's nothing there but coloured
> pixels. If it's AWT then I thought AWT used real OS controls, but ICBW.

I'm working with Kronos Workforce Central 6.3. I can't tell which it uses.

How can we identify whether a Java app is using AWT or Swing?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,813
Messages
2,569,696
Members
45,483
Latest member
TedDvb6626

Latest Threads

Top