Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > GuiTest - scraping the content of dropdown in Jave app?

Reply
Thread Tools

GuiTest - scraping the content of dropdown in Jave app?

 
 
Woland99
Guest
Posts: n/a
 
      10-08-2011
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
 
Reply With Quote
 
 
 
 
Woland99
Guest
Posts: n/a
 
      10-08-2011
On Oct 8, 3:31*pm, Ben Morrow <(E-Mail Removed)> wrote:
> Quoth Woland99 <(E-Mail Removed)>:
>
> > 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?

>
> 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
 
Reply With Quote
 
 
 
 
Woland99
Guest
Posts: n/a
 
      10-09-2011
On Oct 8, 6:04*pm, Ben Morrow <(E-Mail Removed)> wrote:
> Quoth Woland99 <(E-Mail Removed)>:
>
>
>
>
>
>
>
>
>
> > On Oct 8, 3:31 pm, Ben Morrow <(E-Mail Removed)> wrote:
> > > Quoth Woland99 <(E-Mail Removed)>:

>
> > > > Hi - I am trying to use Perl to run a simple test scrip on Java app.. I

>
> > > 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.

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

>
> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WIN32-GUITEST issue Liang He Ruby 2 10-26-2007 05:29 AM
win32-guitest for ruby Kyle Schmitt Ruby 3 03-01-2007 11:13 PM
win32-guitest Allton, Paul Ruby 1 11-12-2004 12:55 PM
Web Scraping/Site Scraping David Jones Python 4 07-13-2004 01:05 AM
Need help with Win32::GuiTest and Indigo perl gw1500se Perl Misc 5 07-06-2003 04:11 AM



Advertisments