Hi Michael,
Both the ways does not work out here... not sure what could be the reason..

Thanks a lot for you help :)

Regards
Niharika



On Fri, Jan 30, 2009 at 10:55 PM, Michael Hwee <michael_h...@yahoo.com>wrote:

> Try with attribute.
>
> frame("xxxxx") is  hack. So, it still might not support properly.
>
> frame(:id, 'xxxx').exists?  if frame has 'id'.
>
> Michael
>
> ------------------------------
> *From:* Niharika Patro <niharikapa...@gmail.com>
> *To:* watir-general@googlegroups.com
> *Sent:* Thursday, January 29, 2009 10:34:21 PM
> *Subject:* [wtr-general] Re: Unable to work with IFrame
>
> Hi Michael,
> Thanks for providing a quick solution. I tried out this, but its still not
> working:
>
> Even though the iframe is existing, the following code is returning false:
>
> puts (@@browser.frame("loginframe").exists?())
>
> Output: false
>
> Any idea, what could be the issue here?
>
> Regards
> Niharika
>
> On Thu, Jan 29, 2009 at 11:00 PM, Michael Hwee <michael_h...@yahoo.com>wrote:
>
>> frame does not support exists?().
>>
>> However, you can *monkey-patch* as followed.
>>
>> module Watir
>>   class Frame
>>     alias_method :_locate, :locate
>>     def locate
>>       begin
>>         return _locate
>>       rescue
>>         return nil
>>       end
>>     end
>>     def exists?
>>       return @o != nil
>>     end
>>   end
>> end
>>
>> Michael
>>
>> ------------------------------
>> *From:* Niharika Patro <niharikapa...@gmail.com>
>> *To:* watir-general@googlegroups.com
>> *Sent:* Thursday, January 29, 2009 4:57:13 AM
>> *Subject:* [wtr-general] Unable to work with IFrame
>>
>> Hi,
>>
>> In my application, when I click on a link it opens a "Iframe".
>>
>> I am trying to verify whether the iframe appears or not with the following
>> code:
>>
>>
>> @@browser
>> .frame("loginframe").exist?() or @@browser.frame(:id, "loginframe").exist?()
>>
>>
>> It throws the following error:
>>
>> test_au_in_utility_panel(VideoPortal_Commenting_Notify):
>>
>> Watir::Exception::UnknownFrameException: Unable to locate a frame with
>> name loginframe
>>
>>  Please help in handling this.
>>
>> Regards
>>
>> Niharika
>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to