Sorry for the wrong XPath.
history.back() is not supported by JWebUnit. But if you know the previous URL
you can simply do
gotoPage(url);
Regards,
Julien
----- Message d'origine ----
De : Abid Hussain <[EMAIL PROTECTED]>
À : Usage problems for JWebUnit <[email protected]>
Envoyé le : Mercredi, 2 Avril 2008, 19h41mn 48s
Objet : Re: [JWebUnit-users] Re : question about button not found
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 <[email protected]>
> 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>Übersicht Verlaufspläne</title>
> <link href="/modulverwaltung/css/format.css" rel="stylesheet"
> type="text/css" />
> </head>
> <body>
> <h1>Übersicht Verlaufspläne</h1>
> <p> </p>
> <h4>Öffentliche Verlaufspläne:</h4>
> <table>
> <tr>
> <td>
> <ul>
> <li><a
>
> href="/modulverwaltung/controller?action=ShowCourseTable&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&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&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&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> </p>
> <form method="post" action="/modulverwaltung/controller?action=Overview">
> <input type="submit" value="Zur Ü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
> [email protected]
> <mailto:[email protected]>
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users
_____________________________________________________________________________
Envoyez avec Yahoo! Mail. Plus de moyens pour rester en contact.
http://mail.yahoo.fr-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users