Scheduling multiple executions of multiple bat files on different machine - batch-file

I find myself in need of testing a multi desktop (between 2-4 different pc's on the same network) long running (each test runs for over an hour, and I cannot predict how long each test will take) program and I am trying to automate the system as much as possible (due to the large number of tests required)
Since I am testing for performance and the system uses collaboration (sharing of data) between nodes, it is vital that all machines run a test at the same time (system clock accuracy is enough, I am not looking at nano seconds) and that only a single test is run at a time (a single process is run on each machine and the next test can only be run once the process on each machine is complete). Therefore it would be ideal to detect when the system has completed execution in order to run the next test.
Each process is started from a batch file (which I prepare before hand). Note also that due to the fact that each process is rendering an image, all cores of the CPU are in use, thus any automation used will need to have low impact on performance.
I am proficient in both C++ and Java (the system in question is in c++), any help is appreciated. Thanks
(If I left anything unclear, please do ask, I do not have a lot of experience on stackoverflow)

You can remotely invoke tasks using the dos command SCHTASKS
so lets say each of your test machines has a scheduled task on them, when you are ready to run them you could have an application or script invoke each of the tasks practically simultaneously (within a second ?)
schtasks /Run /S nameofpctoruntaskon /U usernameofacct /P password /TN nameoftaskonpc /I

Related

Scheduled Task won't work properly for any scheduled task involving a JAR file

Is there any fix to this? So far I've resorted to using a software called "System Scheduler", but I really want to know if I can manage to make it work with Windows' built in Scheduled Task.
.bat:
start /D C:\Jars\Load\ /B LoadInc.jar
I also tried:
"C:\Program Files\Java\jdk1.6.0_19\bin\java.exe" -jar
"C:\Jars\Load\LoadInc.jar"
As for the Task Scheduler, its only function is running the .bat at a specific time. I've tried it of course using "Run now".
I noticed it opens the "javaw" process for like 5 seconds (Meaning it does nothing). But if I go and double click the .bat, it works with no issues and takes like 5 minutes to do the process (Of course, with the process "javaw" open 'til the end").

Quick Test Pro (11) not running when computer is locked

I need to run QTP scripts when I'm not at work. So I'm scheduling (with windows task scheduler), batch files (which calls .vbs files) to call the QTP codes.
They run fine, if the computer is no locked (I have tried with the scheduled taks, and running the .batch directly also).
Even when the computer has been locked for a hour, the QTP scripst run fine.
But if the computer is locked for several hours (for example, if I leave work at 5 pm, and I need to run the scripts after 12 am), the QTP scripts donĀ“t run (neither an error message is popped up, nor QTP in encycled, nor nothing).
Anybody has an idea what need to be done to work this out?
Directly from UFT help file, same applies to QTP:
When running UFT tests or components on a local machine, if the computer on which the application is being tested is locked, your test run may fail.
Workaround:
Install UFT on a virtual machine (without a screen saver or lock password), and start or schedule your run session on the virtual machine. Then you can lock your local computer without locking the virtual machine.
Another workaround (not recommended):
Play any video in loop in Windows Media Player. This will prevent your machine from get locked automatically.
In this scenario you can auto schedule the script through the external free software like Auto-Sys.
There you can create jobs to unlock the machine and then run the regression.
You can simple use the below utility to keep you system unlocked
https://sumeetkushwah.com/2015/11/07/windows-lock-prevention-utility/
use the below code and save this as a .vbs file(SomeName.vbs)
Set WshShell = WScript.CreateObject("WScript.Shell")
Do
WshShell.SendKeys "{CAPSLOCK}"
WScript.sleep (1000) '1000 means one second. choose the time of your liking
WshShell.SendKeys "{NUMLOCK}"
Loop
Double click the saved vbs file. Your computer will not get locked unless you manually kill the WScript.exe task in your task manager. Use the keys of your choice from here http://www.pctools.com/guides/scripting/detail/149/?act=reference

Protractor application get paused when system sleeps

I am working in a large project. There are about minimum 160 specs to be executed with protractor, and it consumes more than one hour to finish automation testing. But issue is my system get sleeps in between it when no action is performed. Is there any way to make system alive until protractor finishes its execution.
So that I could run it without system sleep. I cant increase my sleep time because it had to be run in many sytem. Please let me know how could I handle it ?
I am using chrome for running the automation.
Cheers.
Would it be possible to let me know what OS you are using? So that I can give step by step information. For example: if you are using windows machine then
Goto --> Control Panel\Hardware and Sound\Power Options --> Change the Sleep settings make it to "Never"
It will remain open for your lifetime till you switchoff your computer.
By the way there is no relation this question to Protractor.

Killing every process except system's and my own

I'm trying to make a virus to run on VMWare so I could have some fun with Ubuntu and
experiment with it. Now, I would be interested that my experimental virus (although it's hardly a virus, it's more of an actual program) would be able to kill/terminate every process but itself and the system processes.
I thought of 2 options:
Either I get all the non-system processes IDs and kill each, comparing to mine first, to avoid killing myself.
OR there's an actual command or a function built-in doing that in some, I did some research and I succeeded making my process 'shielded' from any terminating/killing signals, but I'm not sure how to search other processes IDs (non-system ones).
Any idea on how to perform this?
Following command is to list every process on the system.
ps aux

how to automate jcl to run a cobol program on mainframe

We have a COBOL batch program that we are able to execute manually from JCL. We want to automate this process so that it can execute every 15 minutes.
Is there a way to automate the execution of a batch program on the mainframe?
I'm a PC guy and I know in windows I can create a .BAT file and set it up in Task Scheduler to run every 15 minutes. I'm essentially trying to do the same thing on the mainframe.
Is there a way to automate the execution of a batch program on the
mainframe?
Yes.
Many mainframe shops have job schedulers. Control-M from BMC is one, ASG has Zeke, there are others.
Having said that, it sounds like the application in question is written to periodically poll for some event. Mainframes typically have better ways of accomplishing tasks people normally solve via polling. Event monitoring, for example.
Mainframe Scheduling software like Control-M from BMC is one, ASG has Zeke, CA7 from CA and IBM TWS for ZOS formerly OPCA can be used to schedule a job every 15 minutes.
You could add a job for every 15 minute period or have the first step of the job be to add the 1 that will run in the next 15 minutes.
Pros
Operators will be notified of the job failing
Cons
Will end up allot of the same jobs in the schedule
TWS for ZOS (what I am know) you would need to add nearly 96 jobs and set the corresponding times for it
The option I would recommend is using an automation product such System Automation from IBM, Control-O from BMC or OPS from CA.
With any of the above automation products you could setup a started task and get them to start it every 15 minutes. It is much easier say for example using 1 panel in System Automation to set it up to run a start task every 15 minutes
If you wanted to know if it fails you could use the automation products to schedule it in any of the above schedulers.
There are so many solutions to this, it really depends on what you are monitoring. Besides the standard "use a job scheduler like CA7" (with the disadvantage of having so many jobs that run during the day, just kind-of messy).
You could either define an address space (started task) that invokes your COBOL code, and within your COBOL code have it sleep (i.e. wait on a timer) for 15 minutes, wake-up check whatever and go back to sleep. Alternatively, run the job on JES2 but you might have to a little extra so that JES keeps the job active all day!
If this code finds a problem then it can also issue a console message (maybe, you might have to write a little bit of assembler code to do issue a WTO or WTOR), so the the operator either knows (WTO) or knows and has to reply (WTOR) (write to operator with reply).

Resources