QTP VBScript new series + Interview Question Bank on QTP for enrichment of Knowledge in QTP

This Site has been brought to you by HP Certified Expert of QTP.

Exciting new articles for October:

1) QTP Tip:Deselect all Radio Buttons

2) HP QTP Crypt Object

3)Adding Hyperlinks in Excel Spreadsheet

Best of Luck Friends ! ! !

Expert QTP

All Articles are Copyright Protected. These are Free for Reading & Personal Use. Reproduction in Any Form without the Permission is Illegal & Strictly Prohibited.

Copyright © 2009 ExpertQTP

Google Search

Sunday, January 4, 2009

Lock your PC automatically after the execution of QTP Scripts

The beauty of 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 secret project related data.

This remains a small issue in a simple project based company. However it can become extremely devastating issue in case of a company having Finance or Banking related projects, having top most concern for the security of its data.

So one wonders as to what can be the way by which this situation can be tackled?

I had been scratching my head to device a way to lock my PC automatically after my scripts get executed?

Ultimately I cracked the hard nut by a simple way. Now lets see how..

You can use the following QTP Script to lock your PC :

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. This will solve the purpose.

Being Technology Savvy, I am sure you must be curious to read many more interesting articles on QTP; How about subscribing to my Feed? This will help you in automatically knowing the moment I post an article on my Site.

So let us join and let us Learn & Master the great Tool QTP.

Tags: HP QTP, Quicktest Professional, lock PC using QTP

1 comment:

Anonymous said...

Good finding, how about the article KM185060 in the hp knowledgebase?

Copyright © 2009 ExpertQTP