[Webtest] Re: setCheckbox doesn't work for some kind of checkboxes?

Andrew Sickorsky andrew.sickorsky@texunatech.com
Thu, 20 Sep 2007 16:47:39 +0400


This is a multi-part message in MIME format.
--------------040501090307080409040306
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello!
According log in DEBUG mode:
DEBUG (com.gargoylesoftware.htmlunit.WebClient) - Get page for window 
named '', using 
WebRequestSettings[<url="http://localhost:3000/admin/user/create", 
SubmitMethod[name=post], 
EncodingType[name=application/x-www-form-urlencoded], 
[KeyValuePair("user[name]", "Test Finance User"), 
KeyValuePair("user[department_id]", "2"), 
KeyValuePair("user[role_ids][]", "2"), KeyValuePair("user[disabled]", 
"0"), KeyValuePair("user[login]", "_test_finance_userrr"), 
KeyValuePair("user[password]", "changeme"), 
KeyValuePair("user[password_confirmation]", "changeme"), 
KeyValuePair("commit", "Create")], 
{Referer=http://localhost:3000/admin/user/new}, null>]


especially KeyValuePair("user[role_ids][]", "2") - request contains 
checkbox needed.
So, I have no idea why this checkbox is missing if test was performed by 
WebTest. It so strange-if I set it manually all seems ok and POST 
request contains the same data.

> Andrew Sickorsky wrote:
>   
>> Hello!
>> after logging into the system and checking corresponded record I see
>> that checkbox is unchecked.
>>     
>
> not really: you see that your app reacted as if checkbox wasn't checked.
> Please check what for a request is sent to the server and if checkbox
> value is really missing there.
>
> Marc.
>   


--------------040501090307080409040306
Content-Type: text/x-vcard; charset=utf-8;
 name="andrew.sickorsky.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename="andrew.sickorsky.vcf"

YmVnaW46dmNhcmQNCmZuOkFuZHJldyBTaWNrb3Jza3kNCm46U2lja29yc2t5O0FuZHJldw0K
b3JnOnRleHVuYXRlY2gNCmFkcjtkb206OztNYWdpc3RyYWxuYXlhIHN0cmVldCwgNSAtIDMz
O01vc2Nvdw0KZW1haWw7aW50ZXJuZXQ6YW5kcmV3LnNpY2tvcnNreUB0ZXh1bmF0ZWNoLmNv
bQ0KdGl0bGU6VGVzdGVyDQp0ZWw7d29yazorNyA0OTUgOTgwOTA2Nw0KdGVsO2NlbGw6Kzcg
OTA5IDkwNzAzMjgNCngtbW96aWxsYS1odG1sOlRSVUUNCnVybDp3d3cudGV4dW5hdGVjaC5j
b20NCnZlcnNpb246Mi4xDQplbmQ6dmNhcmQNCg0K
--------------040501090307080409040306--