Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Insert Text / Replace Text / Click in Component not working
Insert Text / Replace Text / Click in Component not working [message #870526] Tue, 08 May 2012 14:30 Go to next message
Torsten Walter is currently offline Torsten Walter
Messages: 4
Registered: May 2012
Junior Member
Hello,

I just started working with Jubula. The first tests are running, but now I have some strange behaviour. I would like to test some text fileds in our application. I can verify if a text field is editable. And everything works correctly. The test passes, when the text field is editable and fails if it is not.

As next step I want to enter some text in an editable text field I checked before. Therefor I used the 'Insert Text' functionality. This always fails. I also tried to use 'Replace Text' instead, but it does not work either.

Afterwards I tried to take smaller steps and start with 'Click in Component', but that fails, too.

I am using jubula 1.2.0 on windows. The application under test is written using several external jars and make heavily use of spring and aspect oriented programming.

Any hints how I can start to find find the problem, why jubula does not work with these text fields? Is there any way to get more information, why clicking into the component fails?

Kind regards,
Torsten

Re: Insert Text / Replace Text / Click in Component not working [message #870539 is a reply to message #870526] Tue, 08 May 2012 15:32 Go to previous messageGo to next message
Alexandra Schladebeck is currently offline Alexandra Schladebeck
Messages: 1155
Registered: July 2009
Senior Member
Hi,

Do the logs contain any information? The AUT Agent and Client logs can be seen via the help menu.

Best regards,
Alex
Re: Insert Text / Replace Text / Click in Component not working [message #870625 is a reply to message #870539] Wed, 09 May 2012 06:53 Go to previous messageGo to next message
Torsten Walter is currently offline Torsten Walter
Messages: 4
Registered: May 2012
Junior Member
Hi Alex,

thanks for your reply. I just checked the AUT Agent and Client logs. Both are empty, but the file ${user.home}/.jubula/logs/rc_swing.log containts many exceptions like:

2012-05-09 08:33:39.672 [SwingWorker-pool-21324485-thread-1] ERROR o.e.j.r.s.c.AUTSwingHierarchy - Method called outside of the dispatch thread. This may indicate a potential error in the AUT.
java.lang.Exception: null
at org.eclipse.jubula.rc.swing.components.AUTSwingHierarchy.checkDispatchThread(AUTSwingHierarchy.java:1035) [org.eclipse.jubula.rc.swing_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.rc.swing.components.AUTSwingHierarchy.componentAdded(AUTSwingHierarchy.java:439) [org.eclipse.jubula.rc.swing_1.2.0.201203181048.jar:na]
at java.awt.AWTEventMulticaster.componentAdded(AWTEventMulticaster.java:183) [na:1.6.0_26]
at java.awt.Container.processContainerEvent(Container.java:2067) [na:1.6.0_26]
...



And some exceptions like these:
2012-05-09 08:35:44.017 [Connection.ReaderThread:Socket[addr=v9wa0410188.eatc.mdda.nl/192.168.111.1,port=4679,localport=4729]] ERROR o.e.j.r.c.c.AbstractCapTestCommand - InvocationTargetException:
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_26]
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) ~[org.apache.commons.beanutils_1.7.0.v200902170505.jar:na]
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:162) ~[org.apache.commons.beanutils_1.7.0.v200902170505.jar:na]
at org.eclipse.jubula.rc.common.commands.MethodInvoker.invoke(MethodInvoker.java:64) ~[org.eclipse.jubula.rc.common_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.execute(AbstractCapTestCommand.java:231) ~[org.eclipse.jubula.rc.common_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.Communicator$ConnectionListener.received(Communicator.java:845) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.connection.Connection.fireMessageReceived(Connection.java:402) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.connection.Connection.access$3(Connection.java:391) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.connection.Connection$ReaderThread.run(Connection.java:454) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
Caused by: java.lang.NullPointerException: null
at org.eclipse.jubula.rc.swing.swing.implclasses.JTextComponentImplClass.gdSelect(JTextComponentImplClass.java:233) ~[org.eclipse.jubula.rc.swing_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.rc.swing.swing.implclasses.JTextComponentImplClass.gdReplaceText(JTextComponentImplClass.java:145) ~[org.eclipse.jubula.rc.swing_1.2.0.201203181048.jar:na]
... 12 common frames omitted
2012-05-09 08:35:44.017 [Connection.ReaderThread:Socket[addr=v9wa0410188.eatc.mdda.nl/192.168.111.1,port=4679,localport=4729]] ERROR o.e.j.r.c.c.AbstractCapTestCommand - TargetException:
java.lang.NullPointerException: null
at org.eclipse.jubula.rc.swing.swing.implclasses.JTextComponentImplClass.gdSelect(JTextComponentImplClass.java:233) ~[org.eclipse.jubula.rc.swing_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.rc.swing.swing.implclasses.JTextComponentImplClass.gdReplaceText(JTextComponentImplClass.java:145) ~[org.eclipse.jubula.rc.swing_1.2.0.201203181048.jar:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_26]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_26]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_26]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_26]
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) ~[org.apache.commons.beanutils_1.7.0.v200902170505.jar:na]
at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:162) ~[org.apache.commons.beanutils_1.7.0.v200902170505.jar:na]
at org.eclipse.jubula.rc.common.commands.MethodInvoker.invoke(MethodInvoker.java:64) ~[org.eclipse.jubula.rc.common_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.rc.common.commands.AbstractCapTestCommand.execute(AbstractCapTestCommand.java:231) ~[org.eclipse.jubula.rc.common_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.Communicator$ConnectionListener.received(Communicator.java:845) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.connection.Connection.fireMessageReceived(Connection.java:402) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.connection.Connection.access$3(Connection.java:391) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]
at org.eclipse.jubula.communication.connection.Connection$ReaderThread.run(Connection.java:454) [org.eclipse.jubula.communication_1.2.0.201203181048.jar:na]


Another thing I noticed today is that if I stop and restart the AUT the first time the test is run it can select something and even replace text in the first TextField. If I rerun the test without stopping the AUT the test fails.

Best regards,
Torsten


Re: Insert Text / Replace Text / Click in Component not working [message #870707 is a reply to message #870625] Wed, 09 May 2012 12:10 Go to previous messageGo to next message
Torsten Walter is currently offline Torsten Walter
Messages: 4
Registered: May 2012
Junior Member
Hi,

I added an additional delay and now it is working. In the screenshot everything seemed to be there which gave a false impression, but in fact some initialization code was still running.
I had another problem with a modified TextField which has some default text in it, which disappears if you click in on it to enter some text. As a workaroud I created a test case which does exactly this:
- click in the text field
- replace the text
- press Enter

I fixed the method calls outside of the dispatch thread before, so I am not sure if these had to do with the problem. More information on dispatch thread can be found here:

http: // java.sun.com/products/jfc/tsc/articles/threads/threads1.html.


The only problem left is that if I try to wait for an window to open this fails, but it maybe because the windows I am waiting for are derived from JInternalFrame and I am not sure if these are recognized as windows.

Best regards,
Torsten
Re: Insert Text / Replace Text / Click in Component not working [message #870747 is a reply to message #870707] Wed, 09 May 2012 14:14 Go to previous message
Alexandra Schladebeck is currently offline Alexandra Schladebeck
Messages: 1155
Registered: July 2009
Senior Member
Hi Torsten,

Thanks for the update and posting your solutions.

I'm not sure whether JInternalFrame gets recognized as a window, but just to be sure that it's not a problem with your data, you should make sure that the title you are entering really is the title of the window (it sounds silly, but if you are using "equals", then it may be worth changing to "matches" and making sure your RegEx is correct).

If waiting for the window doesn't work, then try waiting for a component within it Smile

HTH,
Alex
Previous Topic:Double backslashes cause problem for external app
Next Topic:Can't complete first test in the tutorial.
Goto Forum:
  


Current Time: Thu Oct 23 13:17:37 GMT 2014

Powered by FUDForum. Page generated in 0.06082 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software