Hey Thanks for you response ankita. This is what i get when i try your code 

$browser.execute_script("$('input:checkbox[name=\"termsAgree\"]').attr('checked',
 
'checked')").click

Error
 undefined method `click' for nil:NilClass (NoMethodError)

Somehow it can't identify click method. I tired set , focus but same error. 
Any suggestions ?

On Wednesday, November 6, 2013 5:15:33 PM UTC-5, Ankita@Adslot wrote:
>
> I have experienced too that some times we need to trigger the checkbox 
> event with jquery instead of simple watir methods..
>
> Try this, might work..
>
> *$browser.execute_script("$('input:checkbox[name=\"termsAgree\"]').attr('checked',
>  
> 'checked');")*
>
>
> On Thu, Nov 7, 2013 at 9:04 AM, Mihir Dhandhusaria 
> <[email protected]<javascript:>
> > wrote:
>
>> This is my html 
>>
>> <label for="termsAgree" class="checkbox">
>>     <span class="sprite"></span>
>>     <input type="checkbox" name="termsAgree" data-original-title="" 
>> title=""> 
>>     <span class="message">I agree to the <a href="/termsandconditions" 
>> target="_blank" class="inline" title="Terms and Conditions">Terms and 
>> Conditions</a></span>
>> </label>
>>
>> I tired following things and none of them seems to be working.
>>
>> Option 1:
>>   $browser.label(:class => 'checkbox').parent.checkbox(:name => 
>> 'termsAgree').set 
>>
>> Option 2:
>>  $browser.checkbox(:name => 'termsAgree').focus
>>
>>
>> Any help is appreciated. 
>>
>> Thanks 
>>
>>
>>
>>  -- 
>> -- 
>> Before posting, please read http://watir.com/support. In short: search 
>> before you ask, be nice.
>>  
>> [email protected] <javascript:>
>> http://groups.google.com/group/watir-general
>> [email protected] <javascript:>
>>  
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Watir General" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to