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 <[email protected]>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 <[email protected]>
> *To:* [email protected]
> *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 [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---