Here is the scenario:
We are using asgard test tool to clean the db and create test data that will be used by QTP to test UI.
Asgard uses an excel file as test data input and creates the data based on the excel file. Some excel files are small, some are moderately big which causes asgard to run slow/fast. So far I've used wait statement until asgard is done running and then login to browser and do the test. When asgard is invoked a cmd window is popped and it shows what's being deleted/generated.
What I want do is somehow use wscript and as soon as the cmd window is done generating data, return a parameter to QTP test that invoked it so that it can move on. I've read some threads here based on "+wscript" and "+stdout" search criteria but didn't understand how to do what I want to do.
Here is the sample function that runs asgard
Public Function ExecFile(fileName)
Set WshShell = CreateObject ("WSCript.shell")
fileName = """C:\test\subtest\QTP\asgardFiles\" & fileName & """"
runCmd = "runFromQtp -e qa -a test-f " & fileName & " -delete_data_after_test false -delete_all_data false -embedded_mq true -rebuild_schema_and_adduser"
finalCmd = "cmd /K c: & CD C:\ApplicationSource\AsgardJ\trunk\dist & " & runCmd '& " & exit"
Set oExec = WshShell.Exec(finalCmd)
'WshShell.run "cmd /K c: & CD C:\ApplicationSource\AsgardJ\trunk\dist & " & runCmd"
'Set WshShell = Nothing
setupFile = "SOS\CreateExchangeWithValidationTest.xls"
I am calling this function from QTP. Can someone please help me to enhance this function so that once the cmd window is done it returns some parameter to QTP. I don't want to use wait statements anymore. Thanks in advance!