711child / robotframework-swinglibrary

Automatically exported from code.google.com/p/robotframework-swinglibrary
Other
0 stars 0 forks source link

"Select From List" keyword fails in the presence of a horizontal scroll bar #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Run the attached script on the program provided. It gets stuck in a loop 
constantly trying to scroll leftwards, eventually failing with an exception:

$ env CLASSPATH=swinglibrary-1.1.3.jar jython ./testscript.py
Using org.netbeans.jemmy.drivers.DefaultDriverInstaller driver installer
Traceback (most recent call last):
  File "testscript.py", line 15, in <module>
    runKeyword('selectFromList', ['The List', 1])
        at org.robotframework.javalib.library.AnnotationLibrary.retrieveInnerException(AnnotationLibrary.java:93)
        at org.robotframework.javalib.library.AnnotationLibrary.runKeyword(AnnotationLibrary.java:75)
        at org.robotframework.swing.SwingLibrary.runKeyword(SwingLibrary.java:54)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

java.lang.RuntimeException: java.lang.RuntimeException: Scrolling

The reason appears to be a bug in Jemmy, which is apparently trying to scroll 
outside of the event dispatch thread. If I explicitly run the keyword in the 
EDT (see commented code in testscript.py) it works, but for most purposes I 
don't have to explicitly run keywords in the EDT.

I am using RHEL5 linux, SwingLibrary 1.1.3 and JVM 1.6.0.26

Original issue reported on code.google.com by geoff.ba...@gmail.com on 11 Aug 2011 at 1:21

Attachments:

GoogleCodeExporter commented 9 years ago
Since the root cause is a bug in Jemmy, I wonder could we upgrade the bundled 
Jemmy version to the latest one and see is the bug fixed. If the bug still 
exists, it should be reported to Jemmy's tracker.

Good news related to this is that Jemmy project seems to be more active than 
when I looked last time. Its home isn't under netbeans.org anymore but instead 
at http://java.net/projects/jemmy

Bad news related to upgrading the bundled Jemmy is that the version we 
currently use is, AFAIK, pretty old compared to the latest Jemmy version and 
there may be API changes.

Original comment by pekka.klarck on 22 Aug 2011 at 9:21

GoogleCodeExporter commented 9 years ago
The Jemmy project appears to have produced something called JemmyV2 now, which 
certainly sounds like it might have API changes...

Are you sure the Jemmy people will actually fix bugs? They appear to be 
replying on their mailing list now, but activity in the bug tracker shows no 
bug being fixed or even acknowledged since 2009 although several have been 
reported since then. That timescale isn't very useful to us, or to you I 
suspect :)

Note that of the 6 issues my colleague Daniel and I just reported, I would 
guess probably 5 of them are actually Jemmy issues, so this decision impacts 
all of them.

Original comment by geoff.ba...@gmail.com on 23 Aug 2011 at 6:46

GoogleCodeExporter commented 9 years ago

Original comment by pekka.klarck on 13 Sep 2011 at 11:49

GoogleCodeExporter commented 9 years ago
I fixed this by explicitly running ListOperator.selectItems in EDT, as 
suggested in the testscript by Geoff.

Related commit 
https://github.com/robotframework/SwingLibrary/commit/758326db3f77aec21773116c01
b9d948eda5630b

Original comment by janne.t....@gmail.com on 3 May 2012 at 5:40

GoogleCodeExporter commented 9 years ago

Original comment by janne.t....@gmail.com on 4 May 2012 at 10:40