Scenario:- How we can launch our application to be automated from ‘Command Prompt‘ in UFT/QTP?

Solution:- Today we faced the situation, where we were not able to launch application 
from ‘SystemUtil.Run’.Problem was that our application was not directly in the form of .exe, 
but rather it was expecting parameters based on the Region for which we want this to be launched.

To overcome this problem and coming with  reusable function, we adopted an alternate approach of launching our region specific applications from ‘Command Prompt’. 

We hope following code will definitely help our automation lovers, in solving there problem 
of launching. Here we have taken “Notepad” application for launching example.
Created “Shell Script” code for sending keyboard commands.

Please feel free to share your comments and experiences on this.



Command Prompt in UFT

3 Replies to “How to launch Application from Command Prompt in UFT?”

  1. hello
    when I linked and excuted the testA from my system.UFT will run the testA well,but UFT11.5 will closed when the test end. So,if I want auto excute next test (named testB) ,will get fail ;cause UFT closed and open again so that browser cant Be identified .PLZ help me!!!!!! thank you

  2. SystemUtil.Run "C:WindowsSystem32cmd.exe"
    Set ObjWS = CreateObject("Wscript.Shell")
    ObjWS.SendKeys "notepad.exe"
    ObjWS.SendKeys "{ENTER}"
    Set ObjWS = nothing

    Not working for me..
    msgbox " Successfully Opened.."

  3. hello
    when I linked and excuted the testA from my system.UFT will run the testA well,but UFT11.5 will closed when the test end. So,if I want auto excute next test (named testB) ,will get fail ;cause UFT closed and open again so that browser cant Be identified .PLZ help me!!!!!! thank you

Leave a Reply

Your email address will not be published. Required fields are marked *