Forum Discussion
Yes, the batch file reads my input correct and uses it to get the install files that I am looking for. I used ''TestedApps.AppName.Run' command and passed the parameter. This works correctly, but the problem is that while the batch file is still getting all the files, my test suite contines with the rest of the tests.
I only want the rest of the tests to start, once the batch file execution is done. The amount of time required for this varies from 5 minutes to maybe 10 or more minutes. That is the reason I need a way to delay the rest of the tests from executing until this is finished first.
The batch file also has a return code of 0 if it found all the install files correctly.
Hi,
This code snippet should help:
' Run the command and wait for completion
CreateObject("WScript.Shell").Run AFileName, 1, True
More info about used functions is available in MSDN.
- DeepaJ10 years agoContributor
Thanks Alex!
That code works to get my batch file started and waits for its completion before starting other tests.
But when it starts, I need to enter something like the version number of the install files I am looking for. I would like to be able to pass that as a parameter as well, so that the batch file will use that and start it's execution without waiting for user to enter the version info.
Wondering if there is a way to incorporate both passing a parameter to the called batch file as well as waiting for it to complete in the same line of code?
- joseph_michaud10 years agoModerator
In a Keyword test? Just put it all together. Something like this...
Set Variable Value Variables.Project.Var1 "versionInput=Build_Version"
Run Code Snippet Sys.OleObject("WScript.Shell").Run("C:\Folder1\Folder2\App_Name.bat " + Project.Variables.Var1, 1, true)
- DeepaJ10 years agoContributor
Thanks, however still having issues.
I have a keyword test that calls this script and passes it the Build_Version variable.
Running this code, will just bring up the command window for a split second and won't continue executing:
Sub Run_Build (Build_Version)
Sys.OleObject("WScript.Shell").Run "C:\FolderA\FolderB\App_Name.bat + Build_Version", 1, True
End Sub
However this bit of code works correctly:
Sub Run_Build (Build_Version)
CreateObject("WScript.Shell").Run "C:\FolderA\FolderB\App_Name.bat18.00.02", 1, True
End Sub
But, here I want to replace 18.00.02 with the variable. So when I do this, it does not work !
Sub Run_Build (Build_Version)
CreateObject("WScript.Shell").Run "C:\FolderA\FolderB\App_Name.bat Build_Version", 1, True
End Sub
If I have it as + Build_Version, it will say path not found.
Related Content
- 5 months ago
- 3 years ago
- 4 years ago
Recent Discussions
- 21 hours ago
- 21 hours ago