Hi,

When I was writing tests I noticed that it could be usefull to add the 
following methods to complete the set of basic ones:

assertLabeledTextFieldPresent(String textFieldId, String textFieldName, String 
labelContent)
assertLabeledCheckBoxPresent(String checkBoxId, String checkBoxName, String 
labelContent)
assertLabeledSelectBoxPresent(String selectId, String selectName, String 
labelContent)
assertLabeledTextAreaPresent(String textAreaId, String textAreaName, String 
labelContent)
assertLabeledRadioButtonPresent(String radioId, String radioGroup, String 
radioOption, String labelContent)
assertHiddenElementWithNamePresent(String hiddenName)

My first implementation was the following for example for the first one:
        assertElementPresentByXPath("//[EMAIL PROTECTED]"" + labelForName + "\" 
and .=\"" + labelContent + "\"]");
        assertElementPresentByXPath("//[EMAIL PROTECTED]"text\" and @name=\"" + 
textFieldId + "\" and @id=\"" + textFieldName + "\"]");

This clearly defines that we have a label with a for attribute which refers to 
a text field with the given id.
This allows me to detect some errors in the html generated by my jsp's :o)

Yes, indeed, I said "first implementation" because another idea came up while 
writing this mail :o)
The assertLabeledTextFieldPresent could have an extra parameter which is the 
form id or form name. This would imply that we check that a specific form has 
a specific field...

My 1ยข contribution :o)

Regards,

Fred.

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jwebunit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to