when you say 'it is not working'  but we have no idea of what it (the code 
you tried) is, it's hard to provide much in the way of further assistance.

Is this site somewhere publicly accessible? 

The level of nesting (other than making the HTML "fun" to read, should not 
really matter.   Sometimes you might need to try .fire_event("onclick")instead 
of 
.click.  I've heard of cases where that happens, no real idea why.. 

On Thursday, March 21, 2013 1:06:06 PM UTC-7, mc060200778 wrote:
>
> Still it is not working for me.
> The script execution continues successfully giving a perception that 
> button has been clicked but the button is not clicked infact.
>
> in rendered html code, i found this button nested in my Div (almost 8th 
> child div), can it be the reason of subject problem?
>
>
>
> On Thu, Mar 21, 2013 at 2:48 AM, Chuck van der Linden <
> cvande...@climate.com <javascript:>> wrote:
>
>> On Wednesday, March 20, 2013 6:24:09 AM UTC-7, richdownie wrote:
>>
>>> Have you tried waiting for the element?
>>>
>>> http://watirwebdriver.com/**waiting/<http://watirwebdriver.com/waiting/>
>>>
>>
>> That's pretty much what I would have suggested, especially if this is a 
>> page with a lot of ajax type operations, you may need to wait a tiny bit 
>> for the button to be in the proper state, especially if there is client 
>> side code that is examining and validating the values filled in on the form 
>> you are about to submit.
>>
>> I'd start with something like this
>>
>> @browser.button(:id, "btnAddNewCustomer").when_present.click
>>
>> If that does not work, much as I hate to suggest it, you might need a 
>> fixed sleep right before the button click
>>
>> sleep 1
>> @browser.button(:id, "btnAddNewCustomer").click
>>  
>>
>>>
>>>
>>> On Wed, Mar 20, 2013 at 7:36 AM, Sohail Mirza <mrz...@gmail.com> wrote:
>>>
>>>> Finally i am able to resolve it but it works sometime and sometime it 
>>>> does not work
>>>> *@browser.input(:value=>"Create New Customer").click*
>>>>
>>>> please advise another convenient way to handle it?
>>>> Thanks,
>>>>
>>>>
>>>>
>>>> On Tue, Mar 19, 2013 at 6:36 PM, Sohail Mirza <mrz...@gmail.com> wrote:
>>>>
>>>>> No Success Alex. Sorry
>>>>>
>>>>> On Tue, Mar 19, 2013 at 5:22 PM, Alex Shtayer <asht...@gmail.com>wrote:
>>>>>
>>>>>> I don't think that problem in fact that div is nested, but more that 
>>>>>> click event is not working as it should
>>>>>>
>>>>>> Try
>>>>>>
>>>>>> browser.button(:id, "*btnAddNewCustomer*").fire_**event("onclick")
>>>>>> or
>>>>>> browser.button(:id, "*btnAddNewCustomer*").fire_**
>>>>>> event("onmousedown")
>>>>>> or
>>>>>> browser.button(:id, "*btnAddNewCustomer*").send_keys :enter
>>>>>> or
>>>>>> browser.button(:id, "*btnAddNewCustomer*").click
>>>>>> browser.button(:id, "*btnAddNewCustomer*").click
>>>>>> to see whether problem in click action
>>>>>>
>>>>>> -- 
>>>>>> -- 
>>>>>> Before posting, please read http://watir.com/support. In short: 
>>>>>> search before you ask, be nice.
>>>>>>  
>>>>>> watir-...@googlegroups.com
>>>>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
>>>>>> watir-genera...@**googlegroups.com
>>>>>>
>>>>>>  
>>>>>> --- 
>>>>>> 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 watir-genera...@**googlegroups.com.
>>>>>>
>>>>>> For more options, visit 
>>>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>>>> .
>>>>>>  
>>>>>>  
>>>>>>
>>>>>
>>>>>
>>>>  -- 
>>>> -- 
>>>> Before posting, please read http://watir.com/support. In short: search 
>>>> before you ask, be nice.
>>>>  
>>>> watir-...@googlegroups.com
>>>> http://groups.google.com/**group/watir-general<http://groups.google.com/group/watir-general>
>>>> watir-genera...@**googlegroups.com
>>>>
>>>>  
>>>> --- 
>>>> 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 watir-genera...@**googlegroups.com.
>>>>
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>  
>>>>  
>>>>
>>>
>>>
>>>
>>> -- 
>>> http://www.richdownie.com
>>> http://github.com/richdownie 
>>>
>>  -- 
>> -- 
>> Before posting, please read http://watir.com/support. In short: search 
>> before you ask, be nice.
>>  
>> watir-...@googlegroups.com <javascript:>
>> http://groups.google.com/group/watir-general
>> watir-genera...@googlegroups.com <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 watir-genera...@googlegroups.com <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.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

--- 
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 watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to