Hi again,

it's a little confusing, cause one expects that the method
assertButtonPresentWithText(String text)
checks for a button with the text actually seen by the user and not the 
name-attribute of the button...

But the XPath expression
assertElementPresentByXPath("//[EMAIL PROTECTED]'submit' and 
@value='Anpassen']");
finally worked (// instead of \\).

By the way: Am I right, that clicking a button like
<input type="button" name="back" onclick="history.back()" value="Back" 
/> is not supported (cause of using history.back())?

Regards,

Abid


Julien HENRY schrieb:
> Abid,
> 
> I think the problem is that the API is assertSubmitButtonPresent(String 
> name) but "Anpassen" is the value of the button. Either try to add a 
> name to your button, or try to use:
> assertElementPresentByXPath("[EMAIL PROTECTED]'submit' and 
> @value='Anpassen']")
> 
> Regards,
> 
> Julien
> 
> ----- Message d'origine ----
> De : Abid Hussain <[EMAIL PROTECTED]>
> À : Usage problems for JWebUnit <jwebunit-users@lists.sourceforge.net>
> Envoyé le : Mercredi, 2 Avril 2008, 13h41mn 30s
> Objet : [JWebUnit-users] question about button not found
> 
> Hi everybody,
> 
> i have a problem with jwebunit 1.4.1. I am checking if a certain button
> is present, but the button isn't found.
> 
> Neither
> assertSubmitButtonPresent("Anpassen");
> works, nor
> assertButtonPresentWithText("Anpassen");
> does.
> 
> You find the source code below. As you can see there are several forms
> in it, which all contain a submit-button with the text "Anpassen".
> 
> Am I doing anything wrong?
> 
> Best regards,
> 
> Abid
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <html xmlns="http://www.w3.org/1999/xhtml";>
> <head>
> <meta http-equiv="Content-Type" content="text/html; " />
> <title>&Uuml;bersicht Verlaufspläne</title>
> <link href="/modulverwaltung/css/format.css" rel="stylesheet"
>     type="text/css" />
> </head>
> <body>
> <h1>&Uuml;bersicht Verlaufspläne</h1>
> <p>&nbsp;</p>
> <h4>&Ouml;ffentliche Verlaufspläne:</h4>
> <table>
>     <tr>
>         <td>
>         <ul>
>             <li><a
> 
> href="/modulverwaltung/controller?action=ShowCourseTable&amp;planOfStudyId=4">Master
>             Algorithmen</a></li>
>         </ul>
>         </td>
>         <td>
>         <form method="post"
>             action="/modulverwaltung/controller?action=CreateCourseTable">
>         <input type="submit" value="Anpassen" /><input type="hidden"
>             name="planOfStudyId" value="4" /><input type="hidden"
> name="adapt"
>             value="true" /></form>
>         </td>
>     </tr>
>     <tr>
>         <td>
>         <ul>
>             <li><a
> 
> href="/modulverwaltung/controller?action=ShowCourseTable&amp;planOfStudyId=7">ID
>             Security Technologies</a></li>
>         </ul>
>         </td>
>         <td>
>         <form method="post"
>             action="/modulverwaltung/controller?action=CreateCourseTable">
>         <input type="submit" value="Anpassen" /><input type="hidden"
>             name="planOfStudyId" value="7" /><input type="hidden"
> name="adapt"
>             value="true" /></form>
>         </td>
>     </tr>
>     <tr>
>         <td>
>         <ul>
>             <li><a
> 
> href="/modulverwaltung/controller?action=ShowCourseTable&amp;planOfStudyId=22">Test
>             3</a></li>
>         </ul>
>         </td>
>         <td>
>         <form method="post"
>             action="/modulverwaltung/controller?action=CreateCourseTable">
>         <input type="submit" value="Anpassen" /><input type="hidden"
>             name="planOfStudyId" value="22" /><input type="hidden"
> name="adapt"
>             value="true" /></form>
>         </td>
>     </tr>
>     <tr>
>         <td>
>         <ul>
>             <li><a
> 
> href="/modulverwaltung/controller?action=ShowCourseTable&amp;planOfStudyId=5">Bachelor
>             Informatik</a></li>
>         </ul>
>         </td>
>         <td>
>         <form method="post"
>             action="/modulverwaltung/controller?action=CreateCourseTable">
>         <input type="submit" value="Anpassen" /><input type="hidden"
>             name="planOfStudyId" value="5" /><input type="hidden"
> name="adapt"
>             value="true" /></form>
>         </td>
>     </tr>
>     <tr>
>         <td>
>         <ul>
>             <li><a
> 
> href="/modulverwaltung/controller?action=CreateCourseTable">Neuen
>             Verlaufsplan erstellen</a></li>
>         </ul>
>         </td>
>     </tr>
> </table>
> <p>&nbsp;</p>
> <form method="post" action="/modulverwaltung/controller?action=Overview">
> <input type="submit" value="Zur &Uuml;bersicht" /></form>
> </body>
> </html>
> 
> -- 
> 
> Abid Hussain
> Mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> Web: http://www.abid76.de
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> JWebUnit-users mailing list
> JWebUnit-users@lists.sourceforge.net 
> <mailto:JWebUnit-users@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
> 
> 
> ------------------------------------------------------------------------
> Envoyé avec Yahoo! Mail 
> <http://us.rd.yahoo.com/mailuk/taglines/isp/control/*http://us.rd.yahoo.com/evt=52424/*http://fr.docs.yahoo.com/mail/overview/index.html>.
> Plus de moyens pour rester en contact.
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> JWebUnit-users mailing list
> JWebUnit-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jwebunit-users

-- 

Abid Hussain
Mail: [EMAIL PROTECTED]
Web: http://www.abid76.de

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to