[Watinfixture-users] Arrays of checkbox controls with different VALUE's
Status: Alpha
Brought to you by:
kalnir
|
From: Rob M. <rma...@rm...> - 2007-09-14 18:38:24
|
Hey all,
I have a web page that uses "arrays" of controls (i.e. the controls all have
the same NAME value). For example imagine a web page that looks like:
User Id Allowed Not Allowed
------- ------- -----------
abc [ ] [ ]
123 [ ] [ ]
the HTML would look like (outlook syntax and formatting enabled):
<table>
<tr>
<td>User Id</td>
<td>Allowed</td>
<td>No allowed</td>
</tr>
<tr>
<td>
<input type=checkbox name=Allowed value="abc">
</td>
<td>
<input type=checkbox name=NotAllowed value="abc">
</td>
</tr>
<tr>
<td>
<input type=checkbox name=Allowed value="123">
</td>
<td>
<input type=checkbox name=NotAllowed value="123">
</td>
</tr>
</table>
On the server side of processing you end up with 2 arrays, Allowed and
NotAllowed, with entries only for CHECKED checkboxes... and the entry values
are the specified values. Kind of goofy.... but this is _not_ asp.net stuff.
So... my challenge is how to Verify/Check these critters?
What I need to do is specify an ID/NAME _and_ a VALUE.
Looking at the WatiNFixture code I can see that all the UserActions seem to
follow the following pattern:
|MethodNamePrefix|A_User_Entered_Value|MethodNameSuffix|
But I'm unclear on how/why this is so.
What I'd like is:
|!-WatiN.Contrib.WatiNFixture.UserActions-!|
|open browser|
|navigate to|http://localhost/somedarntestpage|
|verify checkbox|TeamMember|value|abc|exists|
The code I think I need is:
public bool VerifyCheckboxValueExists(string checkboxID, string
checkboxValue)
{
// actually do something
return false;
}
But... I don't see how/where to wire up any of the plumbing for getting two
values passed.
Also when I did a quick and dirty test (i.e. just added the code above) now
my test crashes with:
System.TypeLoadException: Could not load type 'fitlibrary.FixtureBase' from
assembly 'FitLibrary, Version=1.0.2339.33496, Culture=neutral,
PublicKeyToken=null'.
at System.Reflection.Assembly.GetExportedTypes()
at fit.ObjectFactory.GetTypeOrInstance(TypeName typeName,
GetTypeOrInstanceDelegate getTypeOrInstance)
at fit.Fixture.LoadFixture(String className)
at fit.Fixture.DoTables(Parse tables
Which makes no sense to me either :)... after I compiled the changes I just
copied the .dll over to my fitness/dotnet directory... is there something
else I should be doing?
So... long and the short... I'm pretty lost :)
Any suggestions?
Regards,
Rob
ps. Note that once the basic verify checkbox by value works I'll want to
extend this to include "is checked", "is not checked", and somehow for
"check checkbox", "uncheck checkbox" and "click checkbox"... maybe with:
|check checkbox with value|<ID>|value|<VALUE>|
|