site
stats
By Anish Pillai Anish Pillai Posted under Did You Know? | General

Quick Tip: How to prevent windows from getting locked during QTP batch run

3 Flares Twitter 0 Facebook 0 Google+ 3 LinkedIn 0 Email -- 3 Flares ×

I guess many of you folks would have faced the situation where, when you run your test scripts in batch mode, the scripts start to fail after a while as your windows machine gets locked.


Mostly this happens because the organizations you work for have certain security rules which automatically locks down your windows machine when it is idle for a certain duration of time. And many a times you would not able to get past this, as this a org-level policy and it’s pretty difficult to get an exception.


There are many different types of solutions to this – the most common one is to install and run some sort of “key-presser” application, which simulates some sort of key press event every 5-10 minutes thereby preventing the windows from getting locked. These sort of applications work well, but again it might be difficult to install these as your company’s software division might put some sort of restriction to download and use these applications.


Well, there is another solution to this. And that too, a very easy one. All that you have to do is – Open Windows Media Player -> run some song or video on it in a loop -> and then leave the media player in minimized state.

QTP - Execute Test Scripts in Batch Mode


As long as the song/video runs continuously in loop in the media player, it would prevent your machine from getting locked. This is as simple as it gets.


And since windows media player is available by default on all the windows machines and it also comes with few default songs, it shouldn’t be a problem to try this out. And yes, don’t forget to put the player on mute. ;–)


Were you aware of this tip already? And has this been useful to you? Let us know your thoughts using the comments section.

Interested in more tips and tricks about QTP? Join our blog to get new articles delivered directly in your inbox.

For more QTP Tutorials, you can visit our QTP Tutorials page. You can also visit our Download Page to view all the downloadable content.

3 Flares Twitter 0 Facebook 0 Google+ 3 LinkedIn 0 Email -- 3 Flares ×
  • aditya

    awesome idea

  • Guest

    The best website i have ever seen to learn software testing…I really appreciate ur hard wrk Anish !!!!.everything s explaines very cleary …Thanks alot agin anish!!!

  • Rajeev Sharma

    The best website i have ever seen to learn software testing…I really appreciate ur hard wrk Anish !!!!.everything s explaines very cleary …Thanks alot agin anish!!!!

  • Ram

    Wow great idea!!….Thanks for sharing

  • A tester

    Hello, its an amazing tip, I so want to try it, but in my company everything is blocked. Media Player cannot play any file.
    I have similar problem in qtp 10, whenever I try to open any previous recorded script, Qtp crashes.

  • Ravi

    🙂 I do same for my PPT presentations

  • Biswadidev

    Try the following code: (Save it as .vbs and execute, it will run for ever)
    'Kill the wscript from the task manager when u want to stop.
    dim i
    i =0
    do while (i<=1)
    UTI_SENDKEYS("{NUMLOCK}")

    Loop

    Function UTI_SENDKEYS(ByVal sKey)
    set WshShell = CreateObject("WScript.Shell")
    WshShell.SendKeys sKey
    wscript.sleep 1000
    set WshShell = NOTHING

    End Function

  • Vishal

    No I didnt know this…its awesome dude.

  • Guest
  • srinath

    Awesome Explanation try to update more information…

    <a href="http://www.indiumsoft.com/core-qa-offerings/test-automation&quot;
    title="Test Automation"><strong>Test
    Automation</strong></a>

  • Rahul Gupta

    Instead..You can use Caffeine Software…..You just have to installed it and machine wont get locked…You can switch off the monitor and QTP execution will happen without any issue of System Lock

  • subhankar mohapatra

    Hi guys,

    Try this script
    Set wshell=CreateObject(Wscript.shell)
    wshell.sendkeys("{NUMLOCK}");
    Wait(3)

    Save this file with.vbs system

  • Wiztech Research

    Nice post..thank you..

    Best PLC training Centre in Chennai
    Visit Us : http://www.processautomationtraining.in

3 Flares Twitter 0 Facebook 0 Google+ 3 LinkedIn 0 Email -- 3 Flares ×