Replying to myself again! Probably a bad sign:
the problem was this: id="searchOptions"
should have been this: t:id="searchOptions"
funny that it worked in the web page but failed the test. Anyway, I
guess that's what the test is for.
David Roberts wrote:
Hi,
I'm having problems instantiating values into a select component when
testing forms. This is my form:
<t:form t:id="searchForm">
<t:errors/>
<t:select id="searchOptions" value="searchType"
model="searchTypes" validate="required"/>
<t:textfield t:id="searchString" t:value="searchString"
validate="required"/>
<input type="submit" value="Search"/>
</t:form>
.... and this is the test:
doc = this.pageTester.renderPage("Search");
form = doc.getElementById("searchForm");
fieldValues = new HashMap<String, String>();
fieldValues.put("searchOptions", "TEL_NO");
fieldValues.put("searchString", "+443739182931");
doc = pageTester.submitForm(form, fieldValues);
Basically, the select component value is left as null. The select is
backed by an EnumSelectModel:
public enum SearchType {
NAME,
TEL_NO
}
Any ideas? thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]