Issue 191 in robotframework-swinglibrary: Button clicked twice when using virtual display

6 views
Skip to first unread message

robotframewor...@googlecode.com

unread,
Aug 8, 2011, 8:34:58 AM8/8/11
to robotframework...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 191 by geoff.ba...@gmail.com: Button clicked twice when using
virtual display
http://code.google.com/p/robotframework-swinglibrary/issues/detail?id=191

Run the attached script on the program provided. If you do so against a
real display, you will see that the button is clicked once as expected. If
you use a virtual display (Xvfb), you will see that it is clicked twice
(note the repeated "Hello World").

$ env CLASSPATH=swinglibrary-1.1.3.jar jython ./testscript.py
Using org.netbeans.jemmy.drivers.DefaultDriverInstaller driver installer
Dialog answered 0
Hello World!
$ Xvfb -ac :58 &
$ env DISPLAY=:58 CLASSPATH=swinglibrary-1.1.3.jar jython ./testscript.py
Using org.netbeans.jemmy.drivers.DefaultDriverInstaller driver installer
Dialog answered 0
Hello World!
Hello World!

I am using RHEL5 linux, SwingLibrary 1.1.3 and JVM 1.6.0.26


Attachments:
testscript.py 486 bytes
sut.py 1.4 KB

robotframewor...@googlecode.com

unread,
Sep 9, 2011, 9:57:58 AM9/9/11
to robotframework...@googlegroups.com

Comment #2 on issue 191 by geoff.ba...@gmail.com: Button clicked twice when

Just got bitten by this again on a different app and wondered if you'd
looked at it at all?

Of all the bugs we've submitted, this is by far the most important for us.
The others we have mostly worked around. Extra clicks (which seem capable
of landing just about anywhere, not just clicking the same thing twice) are
more or less impossible to work around...


robotframewor...@googlecode.com

unread,
Sep 12, 2011, 1:15:22 PM9/12/11
to robotframework...@googlegroups.com

Comment #3 on issue 191 by janne.t.harkonen: Button clicked twice when

We've been somewhat busy recently and this dropped to background. I'll see
tomorrow whether there's anything we can do to this.

robotframewor...@googlecode.com

unread,
Sep 12, 2011, 2:19:21 PM9/12/11
to robotframework...@googlegroups.com

Comment #4 on issue 191 by janne.t.harkonen: Button clicked twice when

I converted the example to a RF test case and could also reproduce the bug
with that.

It seems that the extra click behavior happens once, in the first keyword,
after context has been switched from dialog back to main window, but
subsequent keyword behave normally.

I have no idea about the root cause at this point though.

robotframewor...@googlecode.com

unread,
Sep 13, 2011, 2:31:11 AM9/13/11
to robotframework...@googlegroups.com

Comment #5 on issue 191 by janne.t.harkonen: Button clicked twice when

For some truly bizarre reason, it seems that #makeComponentVisible() that
is used by jemmy's AbstarctButtonOperator causes the click in some cases.

I did find a workaround for this, and could probably make a snapshot
release available shortly.


robotframewor...@googlecode.com

unread,
Sep 13, 2011, 5:30:40 AM9/13/11
to robotframework...@googlegroups.com

Comment #6 on issue 191 by geoff.ba...@gmail.com: Button clicked twice when

Thanks for your efforts Janne. A snapshot release would be great.


robotframewor...@googlecode.com

unread,
Sep 13, 2011, 6:06:54 AM9/13/11
to robotframework...@googlegroups.com
Updates:
Status: Done
Owner: janne.t.harkonen

Comment #7 on issue 191 by janne.t.harkonen: Button clicked twice when

This issue was updated by revision c04da41c95c8.

robotframewor...@googlecode.com

unread,
Sep 14, 2011, 2:33:56 AM9/14/11
to robotframework...@googlegroups.com

Comment #8 on issue 191 by geoff.ba...@gmail.com: Button clicked twice when

I had a little look at the code. I'm a bit concerned that this fix is
eliminating the "correct" click rather than the "extra" one, which might be
a problem in cases where the two clicks hit different buttons (as actually
happens for us most of the time in practice)

I tried to build it myself but gave up after an hour of trying to install
buildr...

Anyway, if you could send me a jar file so I can test this on our real
systems that would be great.


robotframewor...@googlecode.com

unread,
Sep 14, 2011, 6:56:50 AM9/14/11
to robotframework...@googlegroups.com

Comment #9 on issue 191 by janne.t.harkonen: Button clicked twice when

You might be rightfully concerned, and I was actually unable to create a
reliable test case for this. (I tested it with your SUT and it worked
correctly)

I changed our Jenkins build to publish snapshots, you can get latest here:
http://robot.radiaatto.ri.fi/job/RobotFramework-SwingLibrary/

robotframewor...@googlecode.com

unread,
Sep 14, 2011, 8:00:47 AM9/14/11
to robotframework...@googlegroups.com

Comment #10 on issue 191 by geoff.ba...@gmail.com: Button clicked twice

Unfortunately I can confirm that this doesn't help on our real systems. We
still get the extra clicks on different widgets (although it doesn't
eliminate the real clicks, as your additional listener only listens for
extra clicks on the button concerned).

My impression is that the extra click comes in the screen location where
the dialog used to be, so in most real systems it won't hit the same button.

I can also confirm that it does fix the toy test case I provided.

Another thing: in the snapshot both Abbot and Jemmy have been moved inside
org.robotframework, so I have to refer to them as org.robotframework.abbot
and org.robotframework.org.netbeans.jemmy if I want to call them myself
(and most of our workarounds involve calling one or other of these
directly). Is this really intentional? It would be nice to be able to write
code that calls Abbot that doesn't need to know whether the Abbot concerned
is packaged with SwingLibrary.


robotframewor...@googlecode.com

unread,
Sep 14, 2011, 8:40:33 AM9/14/11
to robotframework...@googlegroups.com
Updates:
Status: Accepted

Comment #11 on issue 191 by janne.t.harkonen: Button clicked twice when

Well that's unfortunate.

Since, AFAIK, there's no direct way to control the AWT event queue, I am a
bit at loss about how to fix this, at least without patching jemmy.

I will think about this, and perhaps even try to find out exactly the place
inside jemmy where the additional click is generated, but there are no
guarantees that I am able to fix this, at least for 1.2.

As to the other point, it has always been the intention that the
dependencies of SwingLibrary are under the org.robotframework package, so
that they do not conflict with whatever versions the actual SUT might use.
The version you have seems to be wrongly packaged.

Reopening the issue, since it obviously is not fixed.

robotframewor...@googlecode.com

unread,
Sep 14, 2011, 9:22:06 AM9/14/11
to robotframework...@googlegroups.com

Comment #12 on issue 191 by geoff.ba...@gmail.com: Button clicked twice

One thing to consider is what purpose "makeComponentVisible" actually
serves. Is it necessary to call it at all? As I understood it SwingLibrary
works by doing selectWindow and selectDialog to choose the right windows,
and "makeComponentVisible" seems to be doing that also (somewhat badly...).

In general I think you need a strategy as regards patching Jemmy. I'm
pretty sure the Jemmy project themselves are not fixing bugs. I discussed
this with Pekka before we decided to use SwingLibrary and he generally
suggested maintaining your own copy of Jemmy wouldn't be a problem.

I will do some digging in Jemmy myself also and see if I can make a
testcase with the clicks on different buttons.

As regards packaging, is it really likely that the SUT itself is using
Jemmy or Abbot? In any case, the version I'm using is 1.1.3, the latest
official release, where these are available globally.

robotframewor...@googlecode.com

unread,
Sep 15, 2011, 5:43:16 AM9/15/11
to robotframework...@googlegroups.com

Comment #13 on issue 191 by janne.t.harkonen: Button clicked twice when

I dug the jemmy code a bit more, and to me it seems that using
#makeComponentVisble is unnecessary in our case, since we always insist
that the parent container is selected using `Select *`, which brings the
parent container already to front.

I just removed the #makeComponentVisible() call and at least all of the
SwingLibrary's own tests and the simple test Geoff provided passed.

Can you Geoff test this change against your real world situation?

robotframewor...@googlecode.com

unread,
Sep 15, 2011, 6:25:39 AM9/15/11
to robotframework...@googlegroups.com

Comment #14 on issue 191 by geoff.ba...@gmail.com: Button clicked twice

I have now tested this and it seems to work. Thanks for that! Look forward
to upgrading to 1.2.


robotframewor...@googlecode.com

unread,
Sep 15, 2011, 6:39:45 AM9/15/11
to robotframework...@googlegroups.com
Updates:
Status: Done

Comment #15 on issue 191 by janne.t.harkonen: Button clicked twice when

Since the fix has been verified, I'll close this (again).

Reply all
Reply to author
Forward
0 new messages