Terminating a process does terminate the command that it is running IF the 
process stop method used is capable of terminating the command.  What 
version of STAF is running on the machine where your process that runs 
"Harmony.exe" is being run?

 Also, what is the default process stop using method for stopping this 
process?  To determine this (assuming you're not currently overriding it a 
<stopusing> sub-element in your <process> element), you can do:  STAF 
procesMachine PROCESS LIST SETTINGS (replacing processMachine with the 
hostName or IP address of the machine where the "Harmony.exe" command is 
running..

C:\>STAFf processMachine PROCESS LIST SETTINGS
Response
--------
Default Stop Using Method   : SigKillAll
Default Console Mode        : New
Default Focus               : Background
Process Auth Mode           : Disabled
Default Auth Username       : <None>
Default Auth Password       : <None>
Default Auth Disabled Action: Ignore
Default Shell               : <None>
Default New Console Shell   : <None>
Default Same Console Shell  : <None>

If you are running STAF V3.3.4 or later on your processMachine, then the 
"Default Stop Using Method" will be SigKillAll (unless you've overridden 
the default stop using method).  This method on Windows uses the taskkill 
command to stop a process and their child processes.  This method should 
hopefully be able to kill the "Harmony.exe" command.  If not, you could 
try using the "WM_CLOSE" method to see if it can kill the "Harmony.exe" 
command.  To override the method used to stop a process in a STAX job, you 
can specify the <stopusing> sub-element for a <process> element.  For 
example:

 <process name="'TestP4'">
   <location>target</location>
   <command mode="'shell'">command</command>
   <stderr mode="'stdout'"/>
   <returnstdout/>
   <stopusing>'WM_CLOSE'</stopusing>
 </process>

You should try using the SigKillAll method (make sure STAF V3.3.4 or later 
is installed) and if that doesn't work, then try using the WM_CLOSE method 
to stop the process.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   Cindy Zhu <c...@fekete.com>
To:     Sharon Lucas/Austin/IBM@IBMUS
Date:   03/14/2011 12:36 PM
Subject:        RE: [staf-users] Killing a process on remote machines



Hi Sharon,
 
What I really want is to kill an application under test from a STAX job, 
not a process in the STAX job,  like:
 
I have an automation test on an application called "Harmony.exe". The task 
is terminated due to time out in the STAX job, but the application under 
test is still running. 
 
Can you show me how to kill the application under test(Harmony.exe) from a 
STAX job?
 
Thanks,
 
Cindy
 
From: Sharon Lucas [mailto:luc...@us.ibm.com] 
Sent: March-14-11 11:23 AM
To: Cindy Zhu
Cc: staf-users@lists.sourceforge.net
Subject: Re: [staf-users] Killing a process on remote machines
 
The block element is a wrapper which defines a task for which execution 
control is provided.  You can wrap a <process> element within a <block> 
element in a STAX job.  Then, if you terminate the block that the process 
is running in, STAX will submit a PROCESS STOP request to terminate the 
process.  Note that you can terminate a block via the STAX Monitor or via 
a <terminate> element or by submitting a STAX TERMINATE request.  See 
section "block: Define a Task for which Execution Control is Provided" in 
the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_Block.  In the 
"Usage" sub-section, examples of using a <block> element to wrap a 
<process> element and of using the <terminate block="'YourBlockName'"> 
element to terminate a block are provided.  For more information on the 
<terminate> element, see section "terminate: Terminate a Block" in the 
STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_Terminate_Element
. 

And/or, if you want to stop a process after a specified time period, you 
can wrap the <process> element within a <timer> element.  There's an 
example in section "timer: Define a Task for which Time Control is 
Provided" in the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_Timer 

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:        Cindy Zhu <c...@fekete.com> 
To:        "staf-users@lists.sourceforge.net" 
<staf-users@lists.sourceforge.net> 
Date:        03/14/2011 11:58 AM 
Subject:        [staf-users] Killing a process on remote machines 




Hi, 
  
How can I kill a process on remote machines from a STAX job? 
  
Thanks, 
  
Cindy 
 
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to