`method_missing': unknown property or method `-' (WIN32OLERuntimeError)HRESULT error code:0x80020006

207 views
Skip to first unread message

mats

unread,
Apr 7, 2008, 6:23:01 PM4/7/08
to Watir General
I am using watir to enter text in a text box.

I am on a web page(qa1.test.com) which has a frame and i enter data
into this frame which works fine, later an iframe is loaded from
another server(qa2.test.com) and i am trying to enter a info in this
new frame.

If I use dom inspector and inspect the object, its a frame inside a
frame.

so, I am using the code
ie.frame(:name,"frame1").frame(:name,"frame2").text_field(:id,"input-
textfield").set("1234")


but it gives this error

C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/frame.rb:13:in
`method_missing': unknown property or method
`-' (WIN32OLERuntimeError)
HRESULT error code:0x80020006
Unknown name. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./
watir/frame.rb:13:in `locate'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/frame.rb:
47:in `initialize'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/container.rb:
100:in `new'
from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/container.rb:
100:in `frame'



I tried increasing the amount of sleep seconds and tried adding
ie.wait but no luck

alexande...@finntech.no

unread,
Apr 8, 2008, 2:09:22 AM4/8/08
to watir-...@googlegroups.com
> -----Original Message-----
> From: watir-...@googlegroups.com [mailto:watir-
> gen...@googlegroups.com] On Behalf Of mats
> Sent: Tuesday, April 08, 2008 12:23 AM
> To: Watir General
> Subject: [wtr-general] `method_missing': unknown property or method
`-'
> (WIN32OLERuntimeError)HRESULT error code:0x80020006
>
> so, I am using the code
> ie.frame(:name,"frame1").frame(:name,"frame2").text_field(:id,"input-
> textfield").set("1234")
>
>
> but it gives this error
>
> C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/frame.rb:13:in
> `method_missing': unknown property or method
> `-' (WIN32OLERuntimeError)

Try with 'input-textfield' instead of "input-textfield".


--
Alexander

mats

unread,
Apr 8, 2008, 2:25:43 PM4/8/08
to Watir General

No, That didn't work. Same error.
The problem is that there is iframe inside an iframe and the text box
is inside this second iframe(inner).
If do ie.frame(:name,"frame2").text_field(:id,"input-
> > textfield").set("1234")

Then watir gives "Unable to locate a frame with name frame2"

Please help.

I really need to automate this.
This is the biggest application we have.

Nathan Lane

unread,
Apr 8, 2008, 2:27:34 PM4/8/08
to watir-...@googlegroups.com
If your iframe content isn't hosted in your domain there may be a security issue. Do you know if this is the case?
--
Nathan Lane
Home, http://www.nathandelane.com
Mirror, http://nathandelane.awardspace.com

Nathan Lane

unread,
Apr 8, 2008, 2:28:27 PM4/8/08
to watir-...@googlegroups.com
otherwise maybe this would work:
ie.frame(:name,"frame2").frame.text_field(:id,"input-textfield").set("1234")

mats

unread,
Apr 9, 2008, 2:16:49 AM4/9/08
to Watir General
Nathan,

I tried your example, but that didn't work, its not able to identify
and the second frame directly.
Unable to locate a frame with name frame2
(Watir::Exception::UnknownFrameException)


also, to answer you earlier question, the domain names for both sites
are same. I am currently testing by having both iframes load from same
server to make sure that the issue is not due to different servers
being involved but even then it doesn't work.


On Apr 8, 11:28 am, "Nathan Lane" <nathamberl...@gmail.com> wrote:
> otherwise maybe this would work:
> ie.frame(:name,"frame2").frame.text_field(:id,"input-textfield").set("1234"­)
>
> On Tue, Apr 8, 2008 at 12:27 PM, Nathan Lane <nathamberl...@gmail.com>
> wrote:
>
>
>
>
>
> > If your iframe content isn't hosted in your domain there may be a security
> > issue. Do you know if this is the case?
>
> Mirror,http://nathandelane.awardspace.com- Hide quoted text -
>
> - Show quoted text -

Željko Filipin

unread,
Apr 9, 2008, 7:43:29 AM4/9/08
to watir-...@googlegroups.com
On Tue, Apr 8, 2008 at 8:25 PM, mats <mats.t...@gmail.com> wrote:
> The problem is that there is iframe inside an iframe

Are you sure? "Unable to locate a frame" says that Watir could not find that frame. Is the page public so we can take a look? Can you post html or ie dev toolbar screenshot?

Maybe you have the wrong name of the frame, or frame is nested inside another frame. Hard to tell if we can not take a look.

Željko
--
ZeljkoFilipin.com

Nathan Lane

unread,
Apr 9, 2008, 10:51:12 AM4/9/08
to watir-...@googlegroups.com
mats did say that the frame is contained in another frame - is this problematic for Watir Željko?

Željko Filipin

unread,
Apr 9, 2008, 10:52:45 AM4/9/08
to watir-...@googlegroups.com
On Wed, Apr 9, 2008 at 4:51 PM, Nathan Lane <natham...@gmail.com> wrote:
> the frame is contained in another frame - is this problematic

Should not be. But, I did not have to work with frames a lot, so I really do not know.

Željko

Nathan Lane

unread,
Apr 9, 2008, 11:01:26 AM4/9/08
to watir-...@googlegroups.com
Well let's just simulate the app then - mats, so you have a website with an iframe on it, the iframe contains another website with an iframe and that contains yet another site?

[----------- (iframe, webpage 1)
[
[  [------------ (iframe, webpage 2)
[  [
[  [  [==========] (text box, webpage 3)
[  [
[  [------------
[------------

Is that right?

mats

unread,
Apr 9, 2008, 1:27:27 PM4/9/08
to Watir General

Yes. Nathan. Thats correct. The dom that u came up with is also
correct.
Thanks for looking into it.

I also tried using index of the frame. If do a ie.frame.(:index, 1).
text_field(id:, "textbox1").set("11")
then it tries to get all the text boxes for frame1 and not frame2.

Then I tried ie.frame.(:index, 1). frame(:index,2).text_field(id:,
"textbox1").set("11")
then it says, Unable to locate a frame with index 2
(Watir::Exception::UnknownFrameException)


If I try ie.frame.(:index, 2).text_field(id:, "textbox1").set("11")
then it says, Unable to locate a frame with index 2
(Watir::Exception::UnknownFrameException)


Thanks
maithili

On Apr 9, 8:01 am, "Nathan Lane" <nathamberl...@gmail.com> wrote:
> Well let's just simulate the app then - mats, so you have a website with an
> iframe on it, the iframe contains another website with an iframe and that
> contains yet another site?
>
> [----------- (iframe, webpage 1)
> [
> [  [------------ (iframe, webpage 2)
> [  [
> [  [  [==========] (text box, webpage 3)
> [  [
> [  [------------
> [------------
>
> Is that right?
>
> On Wed, Apr 9, 2008 at 8:52 AM, Željko Filipin <zeljko.fili...@gmail.com>
> wrote:
>
> > On Wed, Apr 9, 2008 at 4:51 PM, Nathan Lane <nathamberl...@gmail.com>

Nathan Lane

unread,
Apr 9, 2008, 1:35:29 PM4/9/08
to watir-...@googlegroups.com
I know that in Watir the frame element is only accessible by a couple of attributes - you could try using the src attribute of each frame.

Nathan Lane

unread,
Apr 9, 2008, 1:37:47 PM4/9/08
to watir-...@googlegroups.com
For example, ie.frame(:src, "http://www.mysite.com/").frame(:src, "http://www.mysite.com/test")

Nathan Lane

unread,
Apr 9, 2008, 1:39:46 PM4/9/08
to watir-...@googlegroups.com
> ie.frame.(:index, 1). frame(:index,2).text_field(id:, "textbox1").set("11")

Actually the above should work, but the frame inside of the first frame is index 1 for that frame (the index is reset for each containing element)

try:

ie.frame.(:index, 1). frame(:index,1).text_field(id:,"textbox1").set("11")

mats

unread,
Apr 9, 2008, 1:53:36 PM4/9/08
to Watir General

I tried
ie.frame.(:index, 1). frame(:index,
1).text_field(id:,"textbox1").set("11")


c:/ruby185/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/frame.rb:13:in
`method_missing': unknown property or method
`-' (WIN32OLERuntimeError)
HRESULT error code:0x80020006



On Apr 9, 10:39 am, "Nathan Lane" <nathamberl...@gmail.com> wrote:
> > ie.frame.(:index, 1). frame(:index,2).text_field(id:,
>
> "textbox1").set("11")
>
> Actually the above should work, but the frame inside of the first frame is
> index 1 for that frame (the index is reset for each containing element)
>
> try:
>
> ie.frame.(:index, 1). frame(:index,1).text_field(id:,"textbox1").set("11")
>
> On Wed, Apr 9, 2008 at 11:37 AM, Nathan Lane <nathamberl...@gmail.com>
> wrote:
>
>
>
> > For example, ie.frame(:src, "http://www.mysite.com/").frame(:src, "
> >http://www.mysite.com/test")
>
> > On Wed, Apr 9, 2008 at 11:35 AM, Nathan Lane <nathamberl...@gmail.com>
> > wrote:
>
> > > I know that in Watir the frame element is only accessible by a couple of
> > > attributes - you could try using the src attribute of each frame.
>

Nathan Lane

unread,
Apr 9, 2008, 1:56:32 PM4/9/08
to watir-...@googlegroups.com
Okay then use the src attribute - the index attribute must not be valid for iframes - iframes (and frames) are a little bit different from other web elements because they replicate a little bit of what the web browser actually does, so in effect you are sort of accessing a web browser within a web browser.

Nathan Lane

unread,
Apr 9, 2008, 2:09:16 PM4/9/08
to watir-...@googlegroups.com
I just tried this on my own website - example mockup of what I understand you have:

require 'watir'
include Watir

ie = IE.start('http://nathandelane.awardspace.com/Frames/frameset.html');
ie.frame(:index, 1).frame(:index, 1).text_field(:id, "testField").set("text here");

and it worked - you can take a look at that site and see if it's a similar architecture to yours or if there is something different.

Nathan

Nathan Lane

unread,
Apr 9, 2008, 2:11:15 PM4/9/08
to watir-...@googlegroups.com
Note that all pages exist in the same domain and are actually relative to each other - no virtual directories or anything.

marekj

unread,
Apr 9, 2008, 2:52:02 PM4/9/08
to watir-...@googlegroups.com
Have you tried from irb? what happens when you run
ie.show_frames
alternative: after getting the correct state of frames for test maybe reattach to ie again to ensure the current DOM.

marekj

Bill Agee

unread,
Apr 9, 2008, 4:24:44 PM4/9/08
to watir-...@googlegroups.com
I was wondering - in the line of code below there's a dot between "ie.frame" and "(:index, 1)".  Is that what the actual code looks like?  If so, that might be an issue...try removing the dot and see what happens.

Nathan Lane

unread,
Apr 9, 2008, 4:27:00 PM4/9/08
to watir-...@googlegroups.com
Good catch Bill, let us know mats.

mats

unread,
Apr 9, 2008, 6:24:32 PM4/9/08
to Watir General

No I don't have a dot between ie.frame and "(:index, 1). Thats
something pasted here on discussions by mistake.

Let me correct it.

ie.frame(:index, 1).text_field(id:, "textbox1").set("11")

On Apr 9, 1:27 pm, "Nathan Lane" <nathamberl...@gmail.com> wrote:
> Good catch Bill, let us know mats.
>
>
>
> On Wed, Apr 9, 2008 at 2:24 PM, Bill Agee <billa...@gmail.com> wrote:
> > I was wondering - in the line of code below there's a dot between
> > "ie.frame" and "(:index, 1)". Is that what the actual code looks like? If
> > so, that might be an issue...try removing the dot and see what happens.
>

mats

unread,
Apr 9, 2008, 6:35:11 PM4/9/08
to Watir General


show_frames doesn't return the second frame. :(

it returns
there 1 frames
frame index: 1 name: frame1

mats

unread,
Apr 9, 2008, 8:35:31 PM4/9/08
to Watir General
wierd thing, if selenium ide, dom inspector and firebug shows the
frame2 easily then why not watir.

Nathan Lane

unread,
Apr 10, 2008, 12:00:39 PM4/10/08
to watir-...@googlegroups.com
So just to clarify, did you do

ie.show_frames

and

ie.frame(:index, 1).show_frames

???

Because if I do both of those on the test site I created, then I get one frame for each one.

Nathan

marekj

unread,
Apr 10, 2008, 12:15:54 PM4/10/08
to watir-...@googlegroups.com
Try the alternative suggested: reattach to IE. reinitialize ie reference perhaps from IRB after the second frame is present
ie = Watir::IE.attach(:how, what)
Then run show_frames to see if second frame shows up.
Perhaps this is trivial to reattach again but maybe something is not set correctly.
give a try.

marekj

mats

unread,
Apr 11, 2008, 1:32:56 PM4/11/08
to Watir General

Hi,

I tried


ie.frame(:index, 1).show_frames

and that gives

there are #<WIN32OLE:0x2e13cf8> frames

mats

unread,
Apr 11, 2008, 1:36:42 PM4/11/08
to Watir General
I had intially tried only ie.show_frames which returned frame1

then, I tried
ie.frame(:index, 1).show_frames which returns "there are #<WIN32OLE:
0x2e13cf8> frames"

Nathan Lane

unread,
Apr 11, 2008, 1:36:59 PM4/11/08
to watir-...@googlegroups.com
What watir version are you using? And what Ruby?

Nathan Lane

unread,
Apr 11, 2008, 1:40:00 PM4/11/08
to watir-...@googlegroups.com
Well - that appears to be some of your problem - because that frame contained by your first frame is not being properly wrapped by watir. So It doesn't seem to be finding the second frame. ie.show_frames should only return one frame, because your page only contains one frame. The page in that frame is what contains the second frame. Somehow that's problematic for you - what version of watir gem are you using, and what version of Ruby?

mats

unread,
Apr 11, 2008, 5:41:52 PM4/11/08
to Watir General

I tried ie.show_frames, that returned frame1

then, i just tried ie.frame(:index,1).show_frames and that returned
"there are #<WIN32OLE:0x2e1e5a4> frames"

mats

unread,
Apr 14, 2008, 2:06:52 PM4/14/08
to Watir General
I tried ie.show_frames and that returned the frame1

I tried ie.frame(:index,1).show_frames and that returned "there are
#<WIN32OLE:0x2e1c664> frames"

c:/ruby185/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/page-
container.rb:73:in `method_missing': unknown property or method
`-' (WIN32OLERuntimeError)
HRESULT error code:0x80020006
Unknown name. from c:/ruby185/lib/ruby/gems/1.8/gems/watir-1.5.3/./
watir/page-container.rb:73:in `show_frames'

mats

unread,
Apr 14, 2008, 2:14:38 PM4/14/08
to Watir General
sorry for pasting same issue several times. i was somehow not able to
see recent messages sent by me.

I will let u know ruby and watir version asap.

Nathan Lane

unread,
Apr 14, 2008, 2:16:34 PM4/14/08
to watir-...@googlegroups.com
Thanks mats, I just want to attempt to reproduce your situation.

mats

unread,
Apr 14, 2008, 2:33:36 PM4/14/08
to Watir General

ruby-1.8.5

watir-1.5.3

I used- gem install watir so installed the latest version of watir

Nathan Lane

unread,
Apr 14, 2008, 3:15:58 PM4/14/08
to watir-...@googlegroups.com
That's exactly the same as what I am using. Are you using IE 7, IE 8, or IE 6? Are you using Windows XP or Windows 2000?

mats

unread,
Apr 14, 2008, 3:55:49 PM4/14/08
to Watir General

I am using IE6 and Windows XP

Nathan Lane

unread,
Apr 14, 2008, 4:18:38 PM4/14/08
to watir-...@googlegroups.com
I suppose it may have something to do with IE 6, but I can't really rule that as the reason. When you go to my frames test site, using your setup, namely http://nathandelane.awardspace.com/Frames/frameset.html , can you, using watir and irb, see both of the iframes?

Basically type these lines into watir on the irb prompt:


require "watir"
include Watir
ie = IE.start("http://nathandelane.awardspace.com/Frames/frameset.html")
ie.show_frames
ie.frame(:index, 1).show_frames
ie.frame(:index, 1).frame(:index, 1).text_field(:index, 1).exists?
ie.frame(:index, 1).frame(:index, 1).text_field(:index, 1).set("text")

Can you do that using irb successfully?
Nathan


On Mon, Apr 14, 2008 at 1:55 PM, mats <mats.t...@gmail.com> wrote:


I am using IE6 and Windows XP




mats

unread,
Apr 14, 2008, 5:12:07 PM4/14/08
to Watir General
ya i could successfully do that using irb. i mean accessing ur data in
frame on ur website

Nathan Lane

unread,
Apr 14, 2008, 6:03:43 PM4/14/08
to watir-...@googlegroups.com
ok, then your website must be arranged somewhat differently than mine. Hmmm...


On Mon, Apr 14, 2008 at 3:12 PM, mats <mats.t...@gmail.com> wrote:

ya i could successfully do that using irb. i mean accessing ur data in
frame on ur website




Bret Pettichord

unread,
Apr 15, 2008, 12:09:16 PM4/15/08
to watir-...@googlegroups.com
Mats,

I've just read throught this entire thread. I'm pretty sure there is a
bug in Watir here with nested frames. I would love to be able to
investigate this further. Do you think there might be a way where we
could reproduce this problem?

Bret

mats wrote:
> I am using watir to enter text in a text box.
>
> I am on a web page(qa1.test.com) which has a frame and i enter data
> into this frame which works fine, later an iframe is loaded from
> another server(qa2.test.com) and i am trying to enter a info in this
> new frame.
>
> If I use dom inspector and inspect the object, its a frame inside a
> frame.
>
> so, I am using the code
> ie.frame(:name,"frame1").frame(:name,"frame2").text_field(:id,"input-
> textfield").set("1234")
>
>
> but it gives this error
>
> C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/frame.rb:13:in


> `method_missing': unknown property or method
> `-' (WIN32OLERuntimeError)
> HRESULT error code:0x80020006

> Unknown name. from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./
> watir/frame.rb:13:in `locate'
> from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/frame.rb:
> 47:in `initialize'
> from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/container.rb:
> 100:in `new'
> from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.3/./watir/container.rb:
> 100:in `frame'
>
>
>
> I tried increasing the amount of sleep seconds and tried adding
> ie.wait but no luck
>
>
> >
>


--
Bret Pettichord
Lead Developer, Watir, http://wtr.rubyforge.org
Blog, http://www.io.com/~wazmo/blog

mats

unread,
May 11, 2008, 8:09:14 PM5/11/08
to Watir General

There are several divs and tables between the two frames and outside
of the 1st frame
> Blog,http://www.io.com/~wazmo/blog- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages