Sha256: af8e46104de448366e3268d2847ee56c9dd4101e7f37851526d904a4bbbc31ad

Contents?: true

Size: 530 Bytes

Versions: 46

Compression:

Stored size: 530 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

46 entries across 46 versions & 2 rubygems

Version Path
watir-classic-3.3.0 lib/watir-classic/process.rb
watir-classic-3.2.0 lib/watir-classic/process.rb
watir-classic-3.2.0.rc1 lib/watir-classic/process.rb
watir-classic-3.1.0 lib/watir-classic/process.rb
watir-classic-3.0.0 lib/watir-classic/process.rb
watir-3.0.0.rc3 lib/watir/process.rb
watir-3.0.0.rc2 lib/watir/process.rb
watir-3.0.0.rc1 lib/watir/process.rb
watir-2.0.4 lib/watir/process.rb
watir-2.0.3 lib/watir/process.rb
watir-2.0.2 lib/watir/process.rb
watir-2.0.2.rc1 lib/watir/process.rb
watir-2.0.1 lib/watir/process.rb
watir-2.0.0 lib/watir/process.rb
watir-2.0.0.rc3 lib/watir/process.rb
watir-2.0.0.rc2 lib/watir/process.rb
watir-1.9.2 lib/watir/process.rb
watir-1.9.2.rc1 lib/watir/process.rb
watir-1.9.1 lib/watir/process.rb
watir-1.9.1.rc1 lib/watir/process.rb