# How to wait for web page containing frame

**URL:** <https://www.ruby-forum.com/t/how-to-wait-for-web-page-containing-frame/175454>\
**Category:** Ruby\
**Created:** [September 14, 2009, 8:30am UTC](https://www.ruby-forum.com/t/how-to-wait-for-web-page-containing-frame/175454 "2009-09-14T08:30:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![shraddha\_dalvi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3ec8ea/32.png) [@shraddha\_dalvi](https://www.ruby-forum.com/u/shraddha_dalvi)\
**Post date:** [September 14, 2009, 8:30am UTC](https://www.ruby-forum.com/t/how-to-wait-for-web-page-containing-frame/175454/1 "2009-09-14T08:30:01Z")

</div>

Hi,  
We have scripted web based application in which some of pages  
contains frames.If the frame in page takes 1 sec to download,script  
throws out the pop up.We have tried by using following code :-

$ie.frame(:name,“frame\_menu”).link(:text,/Wealth Management/).click  
wait\_time = 0  
start\_time = Time.now  
while (! ($ie.ie.busy))  
sleep 0.2  
wait\_time = Time.now - start\_time  
if wait\_time \> 30  
wait\_time = 0  
break  
end  
end  
$ie.wait  
sleep 5

assert($ie.frame(:name,/frame\_wlm/).frame(:name,/page/).contains\_text(/transactions  
in the specified date range/))  
assert($ie.frame(:name,“frame\_acct”).link(:text,/Summary/).exists?)

But it could not worked.  
Also,using following code is not worked:-

$ie.frame(:name,“frame\_menu”).link(:text,/Third Party Account/).click

Watir::Waiter::wait\_until {  
$ie.frame(:name,“frame\_txn”).link(:text,/Print This Page/).exists?}

Watir::Waiter::wait\_until {  
$ie.frame(:name,“frame\_txn”).text\_field(:name,“fldUserReference”).exists?}

Watir::Waiter::wait\_until {  
$ie.frame(:name,“frame\_menu”).link(:text,/Account Activity/).exists?}

Kindly suggest.
