Running QTP Scripts on Locked Machines

2,545 views
Skip to first unread message

KRISHNA CHAITHANYA

unread,
Mar 20, 2012, 8:05:36 AM3/20/12
to mercu...@googlegroups.com

Spectacular Evening all ,

 

Actually we have to run QTP scripts on locked work station.

 

Can anyone shed light on this ?

 

Thanks in advance.


--
Thank you,

Krishna Chaithanya Chinthakayala (Kris)  | Mobile: +91 9885066684

Ganesh muralidharan

unread,
Mar 20, 2012, 8:09:42 AM3/20/12
to mercu...@googlegroups.com
Locked workstation accessed by RDC or citrix machine?

Which version of QTP are you using?


--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Regards,


Ganesh Muralidharan
'God Never Forgets'

KRISHNA CHAITHANYA

unread,
Mar 20, 2012, 8:18:52 AM3/20/12
to mercu...@googlegroups.com
Ganesh - Thank you very much for your quick response. 

Its my local machine. Actually we are developing a internal tool for automation execution, in that process when we schedule a automation task at any particular time , it had to start its execution.

When it was unlocked stated working as expected , but when its in locked state it is not able run the vb & mts scripts through QTP. 

We were using QTP 9.5.

We had browsed in the google , but no use. 

any suggestions or work around for this. 

Ganesh muralidharan

unread,
Mar 20, 2012, 8:33:48 AM3/20/12
to mercu...@googlegroups.com
QTP 11 supports minimized or locked machines via RDC -  http://h30499.www3.hp.com/t5/Functional-Testing-QTP-Support/QTP-11-supports-running-tests-on-on-Minimized-RDP-Remote-Desktop/td-p/2406124 



Are you using Windows Scheduler to trigger script execution? 


--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Archana

unread,
Mar 20, 2012, 9:28:49 AM3/20/12
to mercu...@googlegroups.com
How to lock the computer after completion of script execution in QTP
The good thing about Automation Testing is that Scripts are run in an
unattended mode. Thus, what people usually do is, prepare the batch of
scripts and leave for their homes. After the batch gets over, no
matter even if it passes or even get failed, the PC is unlocked
inviting others to view your sensitive information related to your
project especially if it is Banking/Finance etc.,
Set obj = CreateObject("WScript.Shell")
sCmnd = "%windir%\SYSTEM32\rundll32.exe user32.dll,LockWorkStation"
obj.Run sCmnd, 0, False
The above QTP script will lock your PC automatically. Moreover, I will
suggest you to create this script as a separate script and call this
script lastly in your batch.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

KRISHNA CHAITHANYA

unread,
Mar 20, 2012, 9:46:11 AM3/20/12
to mercu...@googlegroups.com
Ganesh - Thank for info. 

First 2 urls discussion is that to unlock in middle of the execution. 

Actually my scenario is to first unlock the machine & then to start execution.(Means invoke QTP & run the scripts- already ready with the script but not able to unlock the machine) 

In third url it describes to unlock the machine and to work on, which i am trying now. 

I will let you know the outcome once we done.

Archana - What you said is agreed and appreciated about locking the system after execution.

Thank you very for the code and will implement for my project.

Hasibur Rahman Molla

unread,
Mar 20, 2012, 11:39:49 AM3/20/12
to mercu...@googlegroups.com
Hi ,

Can any body tell me how to test a application in VRN with QTP. 


Thanks & Regards
Hasibur

Johnson Solomon

unread,
Mar 20, 2012, 1:44:51 PM3/20/12
to mercu...@googlegroups.com
Hi Krishna,

You can write a vbs file to prevent lock mode. Using WScript.Shell send a key (or combination of keys) at certain interval of time which will keep the system active.

or you can download third party softwares like (caffeine.exe) which will prevent system lock 

With Regards,
Johnson Solomon

Archana

unread,
Mar 21, 2012, 9:10:15 AM3/21/12
to mercu...@googlegroups.com
: How to run QTP when system is locked?, QTP run issue, Qtp system
locked, Registry settings using QTP, run qtp scripts when system is
locked, Run QTP system locked
How to run QTP when system is locked?
Go to start>Run>Regedit>
Change the following registry settings:-
Step 1:Goto HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest
Professional\MicTest
Step 2:Locate the key “SkipEnvironmentChecks”
step 3:Change the value to “1″ (Default value is 0)
Step 4:Restart the QTP.

Now QTP should run with system locked.(make sure unnecessary pop ups
are disabled)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Ganesh muralidharan

unread,
Mar 21, 2012, 9:13:52 AM3/21/12
to mercu...@googlegroups.com
Archana just curious. Does this work on local machine or would it work on a machine which is being accessed via RDC.

KRISHNA CHAITHANYA

unread,
Mar 22, 2012, 1:47:12 AM3/22/12
to mercu...@googlegroups.com, Lalith Chaganti
Johnson - Thank you for your support. 

We had tried through Using WScript.Shell send a key (or combination of keys) but we were not able to achieve the goal. 

Then about caffeine.exe , this app will prevent system to lock. 

Actually my scenario is to first unlock the machine & then to start execution.(Means first unlock the machine and then it has to  invoke QTP & run the scripts, which we were failed to do.) 
  
Ganesh  - With the help of your third url, We have created a .bat file in which i have given dos command "Logon.exe -u <Username> -p <password>" and then schedule the the bat file to run. But unfortunately neither locked nor unlocked the system.  

Archana - We have tried with changing the value to 1 of "SkipEnvironmentChecks" in the registry settings also. Even though we didn't over come this issue. 

At last the work around , we know this is not he best solution but for time being we had kept a dedicated 24/7/365 system only for automation execution in which we are not locking the machine. At round the clock we can invoke a execution.

Really thanks you very much for all for your suggestions and help. 

RAJ SEKHAR

unread,
Mar 22, 2012, 3:11:37 AM3/22/12
to mercu...@googlegroups.com
can you run QTP as a batch from a bat file? if it is possible then use the following Steps:
 
1. Download PSEXEC.exe from net (you have 32bit and 64 bit exe, so choose as per ur requirement)
 
2. Create batch file for running the QTP Scripts and save the bat file as RunqtpScripts.bat and use the following command line..
 

"psexec" + " " + "\\" + strHostName + " " + "-U" + " " + strUserName + " " + "-P" + " " + strPassword + " " + "-c -f" + " " + """" + strCurrentLocation + "\" + "RUNQTPScripts.bat" + """"
 
 read concepts on PSEXEC. which helps to connect to remote machine and run any program.
 
Hope this helps.
 

 

Manoj Gupta

unread,
Mar 23, 2012, 12:33:43 PM3/23/12
to mercu...@googlegroups.com

Have you tried tightvnc? Install tightvnc as server on the remote machine where you want to execute your scripts and install on local. Set login id/password to connect to server, now connect to vnc server through the client to execute your scripts on remote machine.

Reply all
Reply to author
Forward
0 new messages