Add the following line and try it.

require 'watir/process'


Thanks & Regards,
KK

On Thu, Jan 7, 2010 at 7:22 PM, Chandu80 <[email protected]> wrote:

> I have a code written in ruby as follows.
>
>
> def attach_ie(test_site)
>    puts "\n    **Attach to existing IE session**\n\n"
>    site = 'http://'<<test_site<<'/'
>    #sleep 1
>    $ie = Watir::IE.attach(:url, site)
>    cnt = Watir::Process.count 'iexplore.exe'
>    #cnt = $ie.process_count()
>    puts "IE processes active: #{cnt}"
>  end
>
> It is basically written to attach to an already open website.Like for
> eg if I am opening an instance of 'google.com' and I again want to
> connect to the same I would be using this function.
>
> I used two ways to obtain the number of ie processes running.
> 1)cnt = $ie.process_count() where cnt takes in the number of ie
> processes running.
> However when I run the script I get the following error
>
> undefined method `process_count' for #<Watir::IE:0x2d2b9e4>
>
>
> 2) cnt = Watir::Process.count 'iexplore.exe'
> It gave me the error
>
>  uninitialized constant Watir::Process
>
> Please help me with using this process_count method.It is a pre-
> defined method in the Class Watir::IE.
>
> Thanks in advance
>
>
> Regards
> Chandrika
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Watir General" group.
> To post to this group, send email to [email protected]
> Before posting, please read the following guidelines:
> http://wiki.openqa.org/display/WTR/Support
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/watir-general
>
-- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/watir-general

Reply via email to