STAX provides a variable named STAXJobID in a STAX job that contains the 
job ID of the currently running STAX job (as talked about in section "STAX 
Variables" in hte STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_StaxVariables
).  You could provide its value to your Selenium testcase when starting it 
via a <process> element in your STAX job (e.g.  by passing its value as a 
parameter or by setting it as an environment variable via the <env> 
sub-element of the <process> element).

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




From:   sandeep bhosale <sandeep.bhos...@gmail.com>
To:     Sharon Lucas/Austin/IBM@IBMUS, 
Cc:     staf-users@lists.sourceforge.net
Date:   07/26/2013 05:57 AM
Subject:        Re: [staf-users] Need help to send message back to STAF



Hi Sharon,

Thank you for the quick response and the valuable information. I have 
created a handle and using the LOG service I am able to send message to 
STAX Monitor.

The log's Submit request needs a STAX job id to whom the message would be 
send. Now is there any way from where i can get this job id (on the client 
machine where my selenium test cases run)from the STAX Monitor (hosted on 
different machine)?
Right now for testing purpose I am manually putting the job id in my code 
by seeing it on STAX Monitor. 

Below is my code snippet
string Where = "10.211.105.106";
string Service = "STAX";
string Request = "SEND JOB 42 MESSAGE \"Selenium Test Started\"";
string Request1 = "SEND JOB 42 MESSAGE \"Selenium Test FInished\"";


STAFHandle log = new STAFHandle("STAFProc.exe");
                        
log.Submit(Where, Service, Request);
System.Threading.Thread.Sleep(10000);
log.Submit(Where, Service, Request1);


Now in above example the JOB ID 42 is hard-coded. Now when the Job is 
submitted from the STAX Monitor, is there any way from where I can get the 
current Job ID?


Thank You very much for your help.

Regards,
Sandeep



On Thu, Jul 25, 2013 at 6:57 PM, Sharon Lucas <luc...@us.ibm.com> wrote:
You could use the STAF MONITOR service to log a message that the STAX 
Monitor displays for a process running in a STAX job. 

For each <process> element represented in the "Active Job Element" panel 
in the STAX Monitor, if the process generates STAF Monitor Service 
messages (see section "8.11 Monitor Service", subsection "8.11.4 LOG" of 
the STAF User's Guide at 
http://staf.sourceforge.net/current/STAFUG.htm#HDRMONSRV), the current 
monitor message is displayed to the right of the process name and elapsed 
time. The monitor information is periodically refreshed while the process 
is running. If the process has not written any STAF Monitor information, 
the text "No STAF Monitor information available" is displayed. 

Your Selenium test case could create a STAF Handle and use it to submit a 
LOG MESSAGE request to the MONITOR service to send messages to the STAX 
Monitor.  STAF provides APIs to submit STAF service requests for Java, 
Perl, Python, C/C++, and Tcl.  Or you can submit a STAF service request 
using the STAF command line executable. 

Or instead of using the MONITOR service to provide a message to the STAX 
Monitor, you could use the STAX service's SEND MESSAGE request to send a 
message to the STAX Monitor.  See section Request Syntax"", sub-section 
"SEND MESSAGE" in the STAX User's Guide at 
http://staf.sourceforge.net/current/STAX/staxug.html#Header_Send for more 
information.  Your Selenium test case could create a STAF Handle and use 
it to submit a SEND MESSAGE request to the STAX service to send a message 
to the STAX Monitor.  STAF provides APIs to submit STAF service requests 
for Java, Perl, Python, C/C++, and Tcl.  Or you can submit a STAF service 
request using the STAF command line executable

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




From:        Sandeep <sandeep.bhos...@gmail.com> 
To:        staf-users@lists.sourceforge.net, 
Date:        07/25/2013 12:42 AM 
Subject:        [staf-users] Need help to send message back to STAF 



Hi all,

I am evaluating staf framework for my project. I am using STAX along with 
STAF.

I have written some selenium test cases in c#. I am running the selemium 
test 
cases on remote machine. I am running the selenium test cases using the 
STAX 
Job Monitor. While running the selenium test cases on remote machine, I am 
not 
able to get any information on my STAX Job Monitor.

Here I want to send message to the STAX Job Monitor console from my 
selenium 
test cases. Is this possible to send message back to STAX Job Monitor from 
the 
selenium code? Can anybody help me how to do this? 

Thank You,

Regards,
Sandeep


------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users



------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to