lib/firewatir/container.rb in firewatir-1.6.6.rc1 vs lib/firewatir/container.rb in firewatir-1.6.6.rc2
- old
+ new
@@ -468,20 +468,22 @@
# ff.show_all_objects
#
# Output:
# Prints all the available elements on the page.
#
- def show_all_objects
- puts "-----------Objects in the current context-------------"
+ def show_all_objects(output = true)
locate if respond_to?(:locate)
elements = Document.new(self).all
- puts elements.length
- elements.each do |n|
- puts n.tagName
- puts n.to_s
- puts "------------------------------------------"
+ if output
+ puts "-----------Objects in the current context-------------"
+ puts elements.length
+ elements.each do |n|
+ puts n.tagName
+ puts n.to_s
+ puts "------------------------------------------"
+ end
+ puts "Total number of objects in the current context : #{elements.length}"
end
- puts "Total number of objects in the current context : #{elements.length}"
return elements
# Test the index access.
# puts doc[35].to_s
end