Thanks for very swift answers Julien.

Using the XPath example with some modifications did the trick.

For others who might be reading this and having similar problems I would
just like to point out some intricacies:

First:
I had to use forward slashes instead. (I am running on a Windows machine,
I guess that's why.)

Second:
I had to qualify the button by giving the path from the form element and
down.
        assertElementPresentByXPath("//[EMAIL 
PROTECTED]'searchLocationsForm']//[EMAIL PROTECTED]'button'
and @value='OK']");

Best regards
/Johan


> Hi,
>
> assertButtonPresentWithText works for
>
> <button>some text</button>
>
> For your need, try:
>
> assertElementPresentByXPath("[EMAIL PROTECTED]'button'
> and @value='OK']");
>
> ++
>
> Julien
>
>
> --- [EMAIL PROTECTED] a écrit :
>
>> I am trying to assert the presence of a button with
>> value "OK". Since
>> assertButtonPresent only accepts a buttonId as an
>> argument I tried to use
>> assertButtonPresentWithText but this fails.
>>
>> The HTML for the button looks like this:
>>
>> <input type="button"
>> class="button_orange_7px_margin"
>> onclick="javascript:submitForm(this.form,
>> 'submitSearchInfo', null,
>> false)" value="OK" tabindex="5"/>
>>
>>
>> and the assertion code I am using looks like this:
>>
>> assertButtonPresentWithText("OK");
>>
>> I would very much appreciate a hint on what I am
>> doing wrong or if there
>> are any other issues.
>>
>> Best regards
>> /Johan
>>
>>
> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio
>> 2005.
>>
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> JWebUnit-users mailing list
>> [email protected]
>>
> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>>
>
>
>
>       
> _____________________________________________________________________________
> Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo!
> Mail
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> JWebUnit-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jwebunit-users
>


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to