Running Scripts from Batch in Task Scheduler
I have a problem running a batch file from the Task Scheduler. The batch file is to run TestPartner from the command line and run a driver script. The syntax looks like this:
cd "C:\Program Files (x86)\Micro Focus\TestPartner\"
tp -u admin -p admin -d TestPartner -r Common -s Install_and_ConvertFiles
What it does is it calls the TestPartner application (an automated test tool) and run the driver script "Install_and_ConvertFiles". The problem is that when I run the batch file ad-hoc (aka manually), it displays the GUI screens associated with installing an application that I reference in the script; but when I run the batch from the scheduler, there are no GUIs displayed when it performs the application installation as it would have in ad-hoc mode. The result is that the application does not run successfully, and the Test Results (in TestPartner) show a run-time error due to a failure to attach to a GUI window (Failed to find the attach name:
"Application=MSIEXEC.EXE Caption='SW App - InstallShield Wizard'"--SW App is the name of the application I'm trying to install...the name is protected due to potential proprietary implications).
The script is supposed to have the ability to attach to the appropriate GUI windows and click the associated buttons/keys via automated testing...I am testing the sequence of steps one performs when installing the software application using the GUI installer.
Please advise as to how to enable display of GUI windows when running an automated script in the Task Scheduler. This is part of a major task that I need to complete this week, so any assistance will be greatly apppreciated. Thanks.
Re: Running Scripts from Batch in Task Scheduler
I found out from one of my colleagues that the GUI features are suppressed because I set the task (under Security Options) to Run whether the user is logged on or out. I changed the settings to Run only when user is logged on, and the GUI features actually work as a result.
Bottom line, if running a batch file or other script in the Task Scheduler where GUI features are involved, make sure that the batch file/script runs only when you (the user) are logged in.