# Each method in FireWatir::Firefox

**URL:** <https://www.ruby-forum.com/t/each-method-in-firewatir-firefox/181209>\
**Category:** Ruby\
**Created:** [January 7, 2010, 12:47pm UTC](https://www.ruby-forum.com/t/each-method-in-firewatir-firefox/181209 "2010-01-07T12:47:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![manojchourasia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a587f6/32.png) [@manojchourasia](https://www.ruby-forum.com/u/manojchourasia)\
**Post date:** [January 7, 2010, 12:47pm UTC](https://www.ruby-forum.com/t/each-method-in-firewatir-firefox/181209/1 "2010-01-07T12:47:10Z")

</div>

Hi

I am trying to run my script in Firefox. I want to count hoe mant  
Firefox window has opened. I can do it easily in IE by following code.

```
  count=0
  shell = WIN32OLE.new('Shell.Application')
  shell.Windows.each do |window|
    if window.path =~ /Internet Explorer/
      count+=1
    end
  end
  puts count

```

But the window.path here is not having Firefox path even though FF is  
opened. So can any one help me out how can i count number on FF window  
opened?
