how to run QTP scripts from command line prompt? - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming) +--- Thread: how to run QTP scripts from command line prompt? (/Thread-how-to-run-QTP-scripts-from-command-line-prompt) |
how to run QTP scripts from command line prompt? - pra6201 - 01-03-2012 Hi, I have a requirement to run QTP from command line prompt using a .bat file. Could you please help me how to do this? Thanks in advance. RE: how to run QTP scripts from command line prompt? - ravi.gajul - 01-03-2012 Assuming that we have a test script say "Test" on desktop... please include the below code in a vb file namely Test.vbs Code: Dim qtApp 'Declare the Application object variable Now in order to execute QTP script from command line we have to execute the above created vbs file from command prompt which will in turn launch QTP, open the script, run it and will display the result in command prompt only. Open command prompt and write following code: And press enter C:\Documents and Settings\Ravi_Gajul\Desktop>cscript Test.vbs Note : C:\Documents and Settings\Ravi_Gajul\Desktop is the location of Test.vbs..update this accordingly If the script passes the result is declared in command prompt as follows: The Run Status is: Passed Regards, Ravi |