This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Testing and the fly likes move item from one list to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "move item from one list to another" Watch "move item from one list to another" New topic
Author

move item from one list to another

tiffany Chan
Greenhorn

Joined: Feb 08, 2005
Posts: 2
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
tiffany Chan
Greenhorn

Joined: Feb 08, 2005
Posts: 2


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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: move item from one list to another
 
Similar Threads
jWebuniits for diff. languages
Unit testing portlets
Is httpunit support script contains table1 deleteRow( rowno)
Junit error
HttpUnit Help..