-
Junior Member
QTP : executing test from commandline
I am trying to run the QTP from commandline. I managed to execute QTP through commandline but I got as far as opening the QTP application and unable to start the specific test. I found in one of the posts that I need to create the vbs file which I can execute through the batch file. I need to execute specific test. I am not sure what exactly needs to be included in the vbs file since each test folder contains lots of different files.
Can anyone help me found solution or post some working sample code?
THANKS for any suggestions.
-
Expert Member
Re: QTP : executing test from commandline
Simple.. Just type the filename (vbscript name) without extension (.vbs) in the commandprompt.
(u have to type in the directoty where .vbs file is stored)
for example,type this script in notepad and save (login.vbs) it in "c:/"
systemutil.run "c:\program files\mercury interactive\quicktest professional\samples\flight\app\flight4a.exe
dialog("text:=Login").activate
dialog("text:=Lgin").winedit("attached text:=Agent Name:").set "rajaputra"
dialog("text:=Login").winedit("attached text:=Password:").set "mercury"
dialog("text:=Login").winbutton("text:=OK").click
save the notepad as login.vbs in c:/ and close notepad
open commandprompt and type login in c:/
That is. I think U got it. Reply me if u r.
Last edited by rajaputra; 10-09-2007 at 01:29 PM.
-
Contributing Member
Re: QTP : executing test from commandline
You can use the following piece of code
Set qtApp= CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
'Set objExplorer = CreateObject("InternetExplorer.Application")
'objExplorer.Navigate "GIVE URL HERE"
qtApp.Open "C:\Automation\Scripts\" 'PATH WITH SCRIPT NAME HERE
qtApp.Test.Run
you can call open and run as many times you want and call many script which will work as a batch run.
Thanks,
Kunal.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules