Invoke an .exe application from QC Resources
I have a question regarding the QC resources. I have a (C#) app.exe application that I need to run before I run my QTP script. I was able to upload the app.exe to QC resources. My question now is how I can invoke this app.exe application when I run the script from QC? How can I set the path to it in QC?
I know that I need to add the TestID to the Dependencies in QC Resources which I did, but I need to execute the app.exe before running the script from QC.
Thanks in advance
Oh, this is an interesting post.
Well I think you have a TestSet with some QTP test inside. Before you run QTP Test you would like to run the .exe File, wouldn't you?
I think you could do it using VAPI-XP script or a nwe QTP Test that only run your application.
The problem is: where is your application locate? Check if the Project Folder, something like \\..\repository\qc\<DOMAINNAME_ID>\<PROJECT_NAME> . Here there are several folders for attachments, scripts and resources.
so in vbs to run something and then wait for the response you must use these instructions:
myShell = CreateObject("Wscript.Shell")
strArgs = myArgument1 & " " & myArgument2
myShell.Run "AllTheQCServerPathOfYourApp\App.exe" & " " & strArgs, 7, True
myShell = Nothing
The "True" in the Run command wait until the App.exe ends e return the control to the invoker script.
Let me know if this helps you.
To contact me please send mail to firstname.lastname@example.org
IT Site : Home Page - Motu 4 QC - TipsTricks
EN Site: Home - Welcome to motu4qc-en!
1. Not sure why you would upload your .exe file to QC resources at all? Are you maintaining version control or something? Does it need to be available at a central point from a storage perspective?
2. There are fairly standard ways to instantiate any application from QTP/vba and Massimo provides a valid one (even though I would copy the app locally to a temp file before executing rather than running it on the QC host - Activating the application from the QC server repository would not be an optimal solution) , but I question why you don't instantiate it as part of your QTP test?
If you call a function at the start of your QTP test that checks if the process of your app is running or not, then executes app.exe if its not open then you will have a better/robust solution.