Bugs item #1991852, was opened at 2008-06-12 13:34
Message generated for change (Comment added) made by javasquall
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1991852&group_id=61302
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core API
Group: None
Status: Open
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: JavaSquall (javasquall)
Assigned to: Julien HENRY (henryju)
Summary: submit(buttonName, buttonValue) doesn't work
Initial Comment:
I have a big Problem
in my jsp site there are som submit buttons
<div id="button_left"><a href="" id="précédent"
class="button_vor">Précédent</a></div>
<div id="button_middle"><input type="submit" class="button_vor"
name="btnsubmit" value="Aperçu" id="aperçu"></div>
<div id="button_right"><input type="submit" class="button_vor" name="btnsubmit"
value="Suivant" id="suivant"></div>
i want to press the last one with name="btnsubmit" and value="Suivant"
but the method
submit("btnsubmit", "Suivant")
doesn't work
junit.framework.AssertionFailedError: Submit Button [btnsubmit] with value
[Suivant] not found.
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.assertTrue(Assert.java:20)
at
net.sourceforge.jwebunit.junit.WebTester.assertSubmitButtonPresent(WebTester.java:1595)
at net.sourceforge.jwebunit.junit.WebTester.submit(WebTester.java:2296)
at
net.sourceforge.jwebunit.junit.WebTestCase.submit(WebTestCase.java:1752)
at xxxxx.xxxx(xxxx.java:191)
at xxxxx.xxxx(xxxx.java:703)
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:597)
at junit.framework.TestCase.runTest(TestCase.java:164)
at junit.framework.TestCase.runBare(TestCase.java:130)
at
net.sourceforge.jwebunit.junit.WebTestCase.runBare(WebTestCase.java:58)
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:120)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
if i use clickButton("suivant") the test doesn't fail but the submit button is
not pressed....
i know that because after clicking the button is still remain on the same page.
if i click through the application by hand everything is working fine.
how can i press a submit button if i have more than one submit button in my
form and if they have the same name?
whats with a method submit(buttonId).
if there is any other way of clicking the button EXCEPT XPATH please let me
know..
this is really important for me because i writing my diploma over automated
testing with jwebunit and it also includes a practical part
so please respont to
[EMAIL PROTECTED]
thx in advance
kr
squall
----------------------------------------------------------------------
>Comment By: JavaSquall (javasquall)
Date: 2008-06-18 09:17
Message:
Logged In: YES
user_id=2019883
Originator: YES
ok i think i've found the problem.
the buttons are not inside the form due to poor html.
is ther any way to submit the form?
----------------------------------------------------------------------
Comment By: JavaSquall (javasquall)
Date: 2008-06-18 08:23
Message:
Logged In: YES
user_id=2019883
Originator: YES
Yes you are right, but i is a litte bit funky that it doesnt work with my
page.
Maybe there's some problem with the div tags.
Think i have to play around a little
If you have any clue please let me know
kr
squall
----------------------------------------------------------------------
Comment By: Julien HENRY (henryju)
Date: 2008-06-12 15:31
Message:
Logged In: YES
user_id=1235926
Originator: NO
Hi,
If you look at the source code there is a unit test case that seems to do
exactly what you want. Look at MultiNamedButtonForm.html and
FormSubmissionTest.java#testSingleFormMultipleButtonSubmission().
So for me it is working as expected. Otherwise, please write your own test
case and post it here.
Best regards
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=1991852&group_id=61302
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development