Unexpected exception - ClassNotFoundException

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Unexpected exception - ClassNotFoundException

Postby sweigner » Tue Nov 28, 2006 6:36 am

I am getting an exception called "Unexpected exception" when I click in the text field of one of my dialogs. The widget is one of my classes (PlannerText) that has an swt Text field in it. Everytime I click in the text field, I get a ClassNotFoundException and of course, no event is created in the test class. Why is Window Tester not finding my class? Here is the stack trace.

java.lang.ClassNotFoundException: c2bm.ddp.client.widgets.PlannerText
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.io.ObjectInputStream.resolveClass(Unknown Source)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readClass(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
at java.io.ObjectInputStream.readSerialData(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at com.windowtester.swt.event.server.SemanticEventServer.run(SemanticEventServer.java:55)
sweigner
 
Posts: 2
Joined: Tue Nov 28, 2006 6:14 am

Postby Phil Quitslund » Tue Nov 28, 2006 3:29 pm

A limitation of our current recorder implementation is that it only supports SWT widgets. we have a bit of work to do to make it recognize custom widgets such as the one you are trying to record.

In the short term, you should be able to work around this limitation in the runtime by hand-writing your locators. Ideally you could also name the widgets so that they are easy to identify. For instance, if you named your PlannerText widget "c2bm.ddp.client.widgets.PlannerText" you could click it in a testcase as follows:

Code: Select all
ui.click("c2bm.ddp.client.widgets.PlannerText");


For more on naming, see this FAQ entry:

http://downloads.instantiations.com/Win ... e_a_widget

(Incidentally, if the widget is so named, you should also sidestep the classnodef exception you're seeing since the recorder will use the name and will not need to refer to the class -- bonus!)

Let us know if this works for you. Either way, if recording events on unnamed custom widgets is a high ticket item for you, please submit a feature request to:

wintest-support@instantiations.com

Thanks!
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am

Postby sweigner » Wed Nov 29, 2006 6:20 am

My class, PlannerText, is just a class that has a SWT Text widget in it and some code to limit characters. The application only uses SWT widgets. So this is not really a custom widget.

Some parts of our code that use this class seem to record ok. I have not been able to isolate what the difference is. I also have a dialog that seems to generate the same exception.

Scott
sweigner
 
Posts: 2
Joined: Tue Nov 28, 2006 6:14 am

Postby Phil Quitslund » Wed Nov 29, 2006 8:10 am

Interesting... If the problem persists or if you want to follow up either way, please send a bug report to wintest-support@instantiations.com and we'll work on a reproduction and fix.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest