Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Applet GUI testing automation

Reply
Thread Tools

Applet GUI testing automation

 
 
lofenee
Guest
Posts: n/a
 
      07-16-2008
<>
??????:c2e7e232-12b0-429b-97ca-...
> On Jul 16, 5:42 am, "lofenee" <lofe...@gmail.com> wrote:
>> I wonder if java.awt.robot can be used to test an applet without changing
>> any source code?

>
> Robot can be used to test anything which involves mouse, keyboard and
> screen. It, actually, takes control over your mouse, keyboard and have
> ability to have screen shots. It's your real mouse, not mouse inside
> Applet or your Java application.
> You can even write your own VNC server using Robot.
>
> Unfortunately, allowing computer to have control over your mouse/
> keyboard is not good idea. That's the reason why Robot is not used for
> tests.
>
> Alex.
> http://www.myjavaserver.com/~alexfromohio/


I don't know what Robot class you referenced.
As I know, there is a class java.awt.robot, which can locate a swing frame
by a title name and
the widgets(button, check button) in the frame. So I think it's different
from your 'Robot'.


 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-16-2008
On Jul 16, 11:34*pm, "lofenee" <lofe...@gmail.com> wrote:
> <Alex.From.Ohio.J...@gmail.com>
> ??????:c2e7e232-12b0-429b-97ca-bcda292a7...@z72g2000hsb.googlegroups.com....
>
>
>
> > On Jul 16, 5:42 am, "lofenee" <lofe...@gmail.com> wrote:
> >> I wonder if java.awt.robot can be used to test an applet without changing
> >> any source code?

>
> > Robot can be used to test anything which involves mouse, keyboard and
> > screen. It, actually, takes control over your mouse, keyboard and have
> > ability to have screen shots. It's your real mouse, not mouse inside
> > Applet or your Java application.
> > You can even write your own VNC server using Robot.

>
> > Unfortunately, allowing computer to have control over your mouse/
> > keyboard is not good idea. That's the reason why Robot is not used for
> > tests.

...
> I don't know what Robot class you referenced.


You mention again something I meant to mention earlier.
...

> As I know, there is a class java.awt.robot, ...


No, there is no such thing. By Sun's common
nomenclature, you would be referring to a package
if mentioning a lower case 'r'.

My entire earlier replies were based on the
assumption that you actually meant..
'java.awt.Robot' (note the capital 'R').

--
Andrew Thompson
http://pscode.org/
 
Reply With Quote
 
 
 
 
lofenee
Guest
Posts: n/a
 
      07-16-2008
>I am not sure what you mean by 'handler'*.

As following code,
Frame jframe=getFrame("test");;
JButton jbtn=getButton(jframe,"jButton1");


I regard jframe as a handler of the Frame.


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      07-16-2008
On Jul 16, 11:49*pm, Andrew Thompson <andrewtho...@gmail.com> wrote:
...
> My entire earlier replies were based on the
> assumption that you actually meant..
> 'java.awt.Robot' (note the capital 'R').


..and (java.awt.)Robot was the class that alex.from.ohio
was writing about.

--
Andrew Thompson
http://pscode.org/
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      07-16-2008
On Jul 16, 11:54*pm, "lofenee" <lofe...@gmail.com> wrote:
> >I am not sure what you mean by 'handler'*.

>
> As following code,
> Frame jframe=getFrame("test");;
> JButton jbtn=getButton(jframe,"jButton1");
>
> I regard jframe as a handler of the Frame.


OK - sure. The AppletViewer itself will generally
have an 'unknown and inscrutable' name. But this
is where the intermediate 'testing' applet comes
into play (did I mention that before?).

It works like this.

A 'womb' applet loads the applet we need to test.

The womb applet is loaded in applet viewer and
thereafter loads the applet we want to test, but
it has important roles. One of them would be to
obtain a reference to the (J)Frame that is the
AppletViewer.

This allows the loader applet to set the title of
the frame to something that the Robot can identify.

Once that reference is obtained, you might handle
the testing in the 'normal way', though perhaps
with some slight variation,s given the Test applet
is an applet hosted within another applet.

--
Andrew Thompson
http://pscode.org/
 
Reply With Quote
 
lofenee
Guest
Posts: n/a
 
      07-16-2008
> As I know, there is a class java.awt.robot, ...

>No, there is no such thing. By Sun's common
>nomenclature, you would be referring to a package
>if mentioning a lower case 'r'.


>My entire earlier replies were based on the
>assumption that you actually meant..
>'java.awt.Robot' (note the capital 'R').


Sorry for my typo and also for my misunderstanding.
Alex is right.

Then is there any appropriate way to automate testing
the applet?


 
Reply With Quote
 
lofenee
Guest
Posts: n/a
 
      07-17-2008

"Andrew Thompson" <>
??????:2b83569f-c24b-4307-8e81-...
>OK - sure. The AppletViewer itself will generally
>have an 'unknown and inscrutable' name. But this
>is where the intermediate 'testing' applet comes
>into play (did I mention that before?).
>
>It works like this.
>
>A 'womb' applet loads the applet we need to test.
>
>The womb applet is loaded in applet viewer and
>thereafter loads the applet we want to test, but
>it has important roles. One of them would be to
>obtain a reference to the (J)Frame that is the
>AppletViewer.
>
>This allows the loader applet to set the title of
>the frame to something that the Robot can identify.
>
>Once that reference is obtained, you might handle
>the testing in the 'normal way', though perhaps
>with some slight variation,s given the Test applet
>is an applet hosted within another applet.
>
>--
>Andrew Thompson
>http://pscode.org/


Thank you.
In this case FEST may also work.


 
Reply With Quote
 
lofenee
Guest
Posts: n/a
 
      07-18-2008
Is there any way without loading applet by AppletViewer?
That is, the applet shall be loaded by the browser.

Thanks a lot.


 
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
GUI automation tool (windows) Alex Barna Python 26 08-11-2010 10:45 PM
Windows GUI automation question Axel Etzold Ruby 1 08-19-2009 04:59 PM
optionparser to gui automation? Mark Noworolski Ruby 5 03-25-2008 07:33 PM
Supressing the ctrl-c and other keys during word automation in automation apondu ASP .Net 0 07-19-2007 09:10 PM
ECS: Elements of C++ Style Automation Testing ECS Automation Administrator C++ 0 11-16-2004 11:24 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57