Posts: 5
Threads: 1
Joined: Oct 2009
Reputation:
0
10-21-2009, 05:39 PM
(This post was last modified: 10-21-2009, 05:42 PM by nitin7.j@tcs.com.)
Hi,
I'm in a situation where I cant paste the VBscript code into ATP. So I'm calling it from QTP via a .bat file. The .bat file executes the Vbscript and the execution in QTP moves to the next step. I want QTP to wait till the VBscript completes its execution and then move to the next step. 'Wait' is not a feasible option here. Help?
Its QTP not ATP! For some reason I'm unable to edit this post!
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
10-21-2009, 05:50 PM
how do you call the vbscript in QTP? can you paste your lines of code?
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
10-21-2009, 06:00 PM
What is achieved out of the .bat file ? Use a Do..While loop and loop until the value is achieved and after that move to the next line.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Posts: 5
Threads: 1
Joined: Oct 2009
Reputation:
0
10-21-2009, 06:23 PM
cd\
wscript C:\DashboardScript\VBSDashboard_Original.vbs
I write these two lines in a .bat file. When the .bat file is called the Vbscript is executed. This Vbscript runs for a longtime but QTP doesn't wait for it to complete the execution. After executing the 'systemutil.run C:\Dashboard.bat' step, the execution is immediately moved to the next step.
Posts: 1,105
Threads: 18
Joined: Jan 2008
Reputation:
8
10-21-2009, 06:32 PM
As Basanth suggested, on the very last line have a flag set to some value inside vbs. Now in your Do ... Loop, wait for that value to appear. (Of course don't forget to get some other condition as well, lest the program will go in infinite loop in case some error happens inside vbs.)
Posts: 5
Threads: 1
Joined: Oct 2009
Reputation:
0
10-22-2009, 03:39 PM
Ya u r right... there's no need to call via a .bat file. It was pretty stupid! Now I'm executing the Vbscript from QTP like this: systemutil.run "C:\Dashboard.vbs". I've set a variable at the end of the script But the prob still persists. The value being set at the end of VBscript is not being passed to QTP!