Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

move item from one list to another

 
tiffany Chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am using HTTPUNIT and JUNIT tools to do web automation. Most of our html pages contains this feature. I got the following exception when I run the test :

java.lang.RuntimeException: Event 'move(document.dataform.list1,document.dataform.list2)' failed: java.lang.RuntimeException: No such property: length
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:189)
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.performEvent(JavaScript.java:165)
at com.meterware.httpunit.scripting.ScriptableDelegate.doEvent(ScriptableDelegate.java:55)
at com.meterware.httpunit.Button.doOnClickEvent(Button.java:85)
at com.meterware.httpunit.Button.click(Button.java:68)
at test.nci.webtest.telco.MediaServerTest.testAddCallPToMediaServer(MediaServerTest.java:307)
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:324)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)

does anybody knows how to solve this problem or has any idea, please...

tiffany
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Tiffany and welcome to JavaRanch!

First of all, may I ask you to edit your display name so that it's not that obviously fake? You see, that's required by our naming policy.

Thanks.

Now, regarding your question...
Originally posted by tiffany user:
... HttpUnit ... exception ...

java.lang.RuntimeException: Event 'move(document.dataform.list1,document.dataform.list2)' failed: java.lang.RuntimeException: No such property: length
at com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException(JavaScript.java:189)

You may have used a piece of JavaScript that's not supported by HttpUnit's JavaScript engine. Could you post the source code for this move() function?
 
tiffany Chan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


If HTTPUNIT doesn't support this piece of code, what can I do? Can I change the code of mine to solve this problem?

[added code tags - Ilja]

[ February 08, 2005: Message edited by: Ilja Preuss ]

============================================================================
Well, I have found that HTTPUNIT doesn't support the length of list box, so I just comment out fbox.length and tbox.length, it doesn't give me any exception, but when I get the conversation text after the record is saved successfully, I can see from that context text that the item that picked up from box1 doesn't move to box2. Anybody knows how to move item from one box to another with HTTPUNIT?

tiffany
[ February 09, 2005: Message edited by: tiffany Chan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic