[Webunitproj-users] RE: Submiting form having image as submit button
Brought to you by:
dgan
From: Jacqui G. <jgu...@pu...> - 2005-02-17 18:55:30
|
I am also having problems submitting a form with the submit button as an input image button: =20 <INPUT onmouseup=3DbuttonClickOff(this); = onmousedown=3DbuttonClick(this); id=3DLogin onmouseleave=3DbuttonClickOff(this); style=3D"CURSOR: hand" onclick=3Ddocument.loginForm.submit(); type=3Dimage alt=3DLogin src=3D"images/buttons/login_btn.gif" name=3DLogin> =20 Below is the code that I use to find it and click the button: WebLink submit =3D null; // set login form fields loginForm.getTextField(loginUserField, WebTag.FIND_EQUALS).setValue(loginUserValue); // delay Thread.sleep(1000); loginForm.getTextField(loginPswdField, WebTag.FIND_EQUALS).setValue(loginPswdValue); // delay Thread.sleep(1000); try { submit =3D (WebLink)(loginForm.find("alt", loginSubmitText, WebTag.FIND_EQUALS, WebLink.class)[0]); System.err.println("TEST: Found submit button ["+submit.toString()+"]"); } catch (Exception e) { wc.close(); fail("TEST: Did not find Login submit button image [link text =3D "+loginSubmitText+"]"); } =20 submit.click(); currentPage =3D wc.getCurrentState(); =20 The following error is thrown when I run my test: =20 Error invoking method:close er:java.rmi.RemoteException: Error invoking method:java.io.EOFException at java.io.DataInputStream.readInt(DataInputStream.java:397) at com.zeborg.iorpc.Util.readObject(Util.java:98) at com.zeborg.iorpc.RemoteProcessClient.invokeMethod(RemoteProcessClient.ja va:94) at com.zeborg.iorpc.Stub.inokeMethod(Stub.java:41) at com.zeborg.webunit.iorpc.NativeWebClientStub.close(NativeWebClientStub.j ava:69) at com.zeborg.webunit.util.DefaultWebClient.close(DefaultWebClient.java:105 ) at com.purisma.test.WebunitTest.testPCR(WebunitTest.java:248) =20 E Time: 7.5 There was 1 error: 1) testPCR(com.purisma.test.WebunitTest)java.rmi.RemoteException: Bad Stuff happened at com.zeborg.iorpc.Stub.inokeMethod(Stub.java:46) at com.zeborg.webunit.iorpc.NativeWebClientStub.close(NativeWebClientStub.j ava:69) at com.zeborg.webunit.util.DefaultWebClient.close(DefaultWebClient.java:105 ) at com.purisma.test.WebunitTest.testPCR(WebunitTest.java:248) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22) at junit.extensions.TestSetup$1.protect(TestSetup.java:19) at junit.extensions.TestSetup.run(TestSetup.java:23) at com.purisma.test.WebunitTest.main(WebunitTest.java:257) =20 FAILURES!!! Tests run: 1, Failures: 0, Errors: 1 =20 Anyone have any ideas? Thanks, -jacqui =20 |