SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    To find the list of processes in task manager

    Hi All ,

    I need to find the execution status of a specific application (i.e) I need to find whether its running or not . For this I have used the following piece of code
    *****


    sub Process_Listing

    Dim objWMIService, objProcess, colProcess
    Dim strComputer

    strComputer = "."

    Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

    Set colProcess = objWMIService.ExecQuery("Select * from Win32_Process")

    For Each objProcess in colProcess
    Process_List = Process_List&"!"&objProcess.Name
    Next

    log.message Process_List
    Process_Lister=split(Process_List,"!")
    Process_Found=0
    for i=0 to ubound(Process_Lister)-1
    if Process_Lister(i)="VIJAY.exe" then
    Process_Found=1
    end if
    next

    'log.message Process_Found
    end sub
    ********

    Its working fine . But I need to know whether there is any other way to do this . whether test complete provides any built in methods for this. Kindly let me know if any method exists.

    -------
    Thanks & Regards
    Vijay
    ****************
    Thanks & Regards
    VIJAY ANANDH.G
    ****************

  2. #2
    Junior Member
    Join Date
    Oct 2004
    Location
    Auckland, New Zealand
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: To find the list of processes in task manager

    I'm not sure if this is valid VBscript, but the basic approach will work, and is much simpler:

    for i=0 to Sys.ChildCount
    if Sys.Child(i).ProcessName="VIJAY.exe" then
    Process_Found=1
    end if
    next

    By the way, why does your code build a string list from an array, then split it straight back out into an array again? Weird.

  3. #3
    Senior Member
    Join Date
    Aug 2006
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: To find the list of processes in task manager

    Hi,

    You can try obtaining the necessary application by using the Sys.WaitProcess method (see the "WaitProcess Method" help topic) and check its Exists property value. This method will not cause errors if the application is not found.
    Jared - AQA Support

  4. #4
    Junior Member
    Join Date
    Apr 2010
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: To find the list of processes in task manager

    Jared , This is not the thing I require. Any how thanks.
    ****************
    Thanks & Regards
    VIJAY ANANDH.G
    ****************

  5. #5
    Junior Member
    Join Date
    Oct 2004
    Location
    Auckland, New Zealand
    Posts
    26
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: To find the list of processes in task manager

    It seems like either of those methods would be equivalent to your code. What's missing?

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:50 PM.

Copyright BetaSoft Inc.