Batch File or VBscript File to execute a single TST or all available TST in the workspace
I am trying to create a Vbscript/Batch file which will launch the SOAtest and execute a single TST or all the TST available in the workspace. I am trying to find my question in the forums but no help.
Can anyone help me out here.
Workspace Name: APITest
TestScript Name: Login.tst
Best Answer
-
@Ndey
you need to start with Testing from the Command Line Interface - soatestcli
There will be just one difference in commands to execute tests:- in case that you want to execute one or selected TST in workspace, you have to include -resource option
- in case that you want to execute ALL TSTs in workspace, skip -resource option
Some examples of soatestcli call:
command to execute all TSTs:
soatestcli.exe -data "c:\APITest" -config "builtin://Demo Configuration"
command to execute all TSTs but with non-default preferences:
soatestcli.exe -data "c:\APITest" -config "builtin://Demo Configuration" -localsettings
my_local.propertiescommand to execute just one TST with non-default preferences:
soatestcli.exe -data "c:\APITest" -config "builtin://Demo Configuration" -localsettings my_local.properties -resource "Login/Login.tst"
In last case I have assumed that you have Login.tst in project folder called Login.
In your case (as you want to run soatest using VBScript or batch file), call might looks like:
VBScript template:Set oShell = CreateObject ("WScript.Shell") oShell.run "soatestcli.exe -data ""c:\APITest"" -config ""builtin://Demo Configuration"" "
batch file template:
@echo off soatestcli.exe -data "c:\APITest" -config "builtin://Demo Configuration"
--
Ireneusz Szmigiel
http://www.catb.org/esr/faqs/smart-questions.html5
Answers
-
Thank you.. But I am getting error in oshell.run. It is showing "The aystem cannot find the file specified."
0 -
@Ndey
try to use full path for soatestcli.exe as you might not have it set with PATH variable.--
Ireneusz Szmigiel
http://www.catb.org/esr/faqs/smart-questions.html0 -
Thanks you.. It is running now. BUt due to limitation of the license We are not able to run through command line. So it will be helpful if we have something similar when not using the soatestcli.exe instead using the soatest.exe
0 -
You need the proper license to run through the command line using soatestcli.exe. Please contact your Parasoft representative for assistance in getting the license you need.
1