korimo / firewatir

Automatically exported from code.google.com/p/firewatir
0 stars 0 forks source link

element_name error in firewatir.rb #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. goto any page
2. @ff.document.links

What is the expected output? What do you see instead?
All the links
No error

Error:
undefined method `element_name' for #<Document:0x653c2c>

What version of the product are you using? On what operating system?
v1.1
OSX 10.5

Please provide any additional information below.
.document calls
Document.new("#{DOCUMENT_VAR}") 

But later when making the jssh call in in all uses  container.element_name but 
Document is 
created with a string for the container.  I tried replacing #{DOCUMENT_VAR} 
with  self like 
firewatir.rb had else where but I still get the error.   

Original issue reported on code.google.com by SbeckerIV@gmail.com on 11 Nov 2007 at 4:20

GoogleCodeExporter commented 9 years ago
This is fixed if you add a check for the class of being the type of string on 
MozillaBaseElements.rb:1381  

if(@container.class == FireWatir::Firefox || @container.kind_of?(String) || 
@container.class == Frame)

Original comment by SbeckerIV@gmail.com on 11 Nov 2007 at 4:39

GoogleCodeExporter commented 9 years ago
Changing the document call to using Document.new(self) did work.  I am unsure 
why my debugger was giving 
the same error.

Original comment by SbeckerIV@gmail.com on 11 Nov 2007 at 4:42

GoogleCodeExporter commented 9 years ago
I think correct usage is 
puts ff.links

See unittests for more details.

Original comment by ang...@gmail.com on 12 Nov 2007 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by ang...@gmail.com on 4 Feb 2008 at 7:06