How to execute PowerShell Script at the end of a Scenario?

108 views
Skip to first unread message

Mohammad Fozlul Hoque Bhuiyan

unread,
Feb 26, 2017, 11:24:05 AM2/26/17
to LoadRunner
Hi,

I want to build a LoadRunner automation framework that will send email to appropriate group when we run a scenario either from Performance Center or from a local Controller Machine. I am using PowerShell to send the email.

The Problem is:

If I put the PowerShell code to the Vuser script it sends email for every Vuser in the Scenario. If I run the Scenario of 100 user it will send 100 email.

How can I execute a code section at the end of a Scenario run, just before the Scenario completion?

Thanks

Fozlul
 

James Pulley

unread,
Feb 27, 2017, 8:53:05 AM2/27/17
to LoadRunner
Consider a single virtual user in a single group which is scheduled to run last, after the completion of your core test virtual users.  In this group you may include a user which invokes a Powershell script or, as I would recommend, take advantage of a Winsock Script, A standard C/VB/JavaScript script or an SMTP script to directly communicate with your SMTP relay and send the message within the script itself rather than invoke a shell script.

Food for thought,

James Pulley

aravind sai kuchibhatla

unread,
Feb 27, 2017, 8:53:09 AM2/27/17
to LR-Loa...@googlegroups.com
Put the code in Vuser_end

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunner+unsubscribe@googlegroups.com.
To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.
To view this discussion on the web visit https://groups.google.com/d/msgid/LR-LoadRunner/16c6dfd5-8e78-4527-9ef1-63fba54d80e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

lior avni

unread,
Feb 27, 2017, 8:53:17 AM2/27/17
to LoadRunner
Hi Fozlul,
May I suggest you use the Jenkins plugin?
you can setup an automated job to run your scenario and configure it to send you an email at the end of the run.
it can even run your analysis session and email you a report at the end.
I recommend going through this blog and also this blog to learn more on the options using the plugin for your load tests.
Thanks,
Lior

Praveen Dama

unread,
Feb 27, 2017, 2:10:40 PM2/27/17
to LR-Loa...@googlegroups.com
1. Create custom LR code with blat.exe and pick HTML report from results directory.

 2. schedule a job from windows scheduler to run email code after completion of analysis


--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunne...@googlegroups.com.

To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.

Mital Majmundar

unread,
Feb 28, 2017, 8:37:15 AM2/28/17
to LR-Loa...@googlegroups.com
You can think of a group by schedule. Just run the script with the power shell script after you main scripts are executed.

Let me know if this option is feasible for you as i am also planning such activity.


 
Mital Majmundar

--
You received this message because you are subscribed to the Google Groups "LoadRunner" group.
To unsubscribe from this group and stop receiving emails from it, send an email to LR-LoadRunner+unsubscribe@googlegroups.com.

To post to this group, send email to LR-Loa...@googlegroups.com.
Visit this group at https://groups.google.com/group/LR-LoadRunner.
Reply all
Reply to author
Forward
0 new messages