GuiTest - scraping the content of dropdown in Jave app?

Discussion in 'Perl Misc' started by Woland99, Oct 8, 2011.

  1. Woland99

    Woland99 Guest

    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
     
    Woland99, Oct 8, 2011
    #1
    1. Advertising

  2. Woland99

    Woland99 Guest

    On Oct 8, 3:31 pm, Ben Morrow <> wrote:
    > Quoth 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?

    >
    > 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
     
    Woland99, Oct 8, 2011
    #2
    1. Advertising

  3. Woland99

    Woland99 Guest

    On Oct 8, 6:04 pm, Ben Morrow <> wrote:
    > Quoth Woland99 <>:
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > > On Oct 8, 3:31 pm, Ben Morrow <> wrote:
    > > > Quoth Woland99 <>:

    >
    > > > > 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.
     
    Woland99, Oct 9, 2011
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Jones

    Web Scraping/Site Scraping

    David Jones, Jul 11, 2004, in forum: Python
    Replies:
    4
    Views:
    539
    Andrew Bennetts
    Jul 13, 2004
  2. Allton, Paul

    win32-guitest

    Allton, Paul, Nov 12, 2004, in forum: Ruby
    Replies:
    1
    Views:
    147
    Chad Fowler
    Nov 12, 2004
  3. Kyle Schmitt

    win32-guitest for ruby

    Kyle Schmitt, Mar 1, 2007, in forum: Ruby
    Replies:
    3
    Views:
    121
    Paul Rogers
    Mar 1, 2007
  4. Liang He

    WIN32-GUITEST issue

    Liang He, Oct 25, 2007, in forum: Ruby
    Replies:
    2
    Views:
    113
    Manish Sapariya
    Oct 26, 2007
  5. gw1500se
    Replies:
    5
    Views:
    151
    gw1500se
    Jul 6, 2003
Loading...

Share This Page