Sha256: 5d0079dc01aafda80df32af11984ea12c27bbd908fd16ca164322811d1ffe2d0

Contents?: true

Size: 511 Bytes

Versions: 1

Compression:

Stored size: 511 Bytes

Contents

module Watir
  module Process
    
    # Returns the number of windows processes running with the specified name.
    def self.count name
      mgmt = WIN32OLE.connect('winmgmts:\\\\.')
      processes = mgmt.InstancesOf('win32_process')
      processes.extend Enumerable
      processes.select{|x| x.name == name}.length
    end
    
  end
  
  class IE
    # Returns the number of IEXPLORE processes currently running.
    def self.process_count
      Watir::Process.count 'iexplore.exe'
    end    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
watir-1.6.5 lib/watir/process.rb