the exists? method is useful for this.
You can also do something like this
ie.button(:value , 'Click me for ajax').click
until ie.div(:id , 'from_ajax').exists?
sleep 1
# add stuff here so you dont wait for ever
end
I thought that there was also a method like
ie..div(:id , 'from_ajax').wait_until_exists_with_timeout( 5 )
but I cant see it now...
Paul
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, February 28, 2007 5:53 PM
Subject: Re: [Wtr-general] Watir with Ajax
> Parv ,
>
> Making the process sleep for one second to wait for dynamically
> generated controls
> does not sound like a reliable process to me.
>
> I thought Watir was handling AJAX stuff.
>
> Thanks to all the Watir guys to let us know what is in Watir specially
> developed for AJAX and HTML.
>
> F!
>
> Parv wrote:
>> I ran into this issue a while back. Since, then whenever i deal with
>> controls that are generated dynamically i make the process sleep for one
>> second before interacting with the control. You have to manually
>> synchronize your script. It has always worked for me.
>>
>> Copying and pasting the html source will not help, because (among other
>> reasons) the html source is generated when the page has finished loading
>> and that point the control/object is available for interaction.
>>
>> Perhaps watir should be modify so it is easier to deal with ajax (because
>> ajax interacts with server differently from the regular http
>> response/request)
>> ---------------------------------------------------------------------
>> Posted via Jive Forums
>> http://forums.openqa.org/thread.jspa?threadID=6170&messageID=19362#19362
>> _______________________________________________
>> Wtr-general mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/wtr-general
>>
>>
>>
>
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general