Micro Focus QTP (UFT) Forums
execute tests using VB Script - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: execute tests using VB Script (/Thread-execute-tests-using-VB-Script)



execute tests using VB Script - sahithiqtp - 07-25-2011

Hi All,

I am new to QTP. I was doing a sample for executing test from another test(VB scripting) in QTP. Below is the code snippet

Code:
set qtApp1 = CreateObject("QuickTest.Application")
If Not qtApp1.Launched then
qtApp1.Launch
end if
qtApp1.Visible = True '
qtApp1.Options.Run.RunMode = "Fast"
qtApp1.Options.Run.ViewResults = True

qtApp1.Open "D:\Test2"

set qtTest = qtApp1.Test
qtTest.Run
qtTest.Close
qtApp1.Quit

I am getting a runtime error while executing the above code. It kicks me out at qtApp1.Open "D:\Test2" saying "The operation failed because the application is busy"

Could you please let me know what could be the reason for this type of error


RE: execute tests using VB Script - rajpes - 07-25-2011

Try the below code after killing all instances of QTPro.exe in task manager>processes

Code:
set qtApp1 = CreateObject("QuickTest.Application")
If Not qtApp1.Launched then
qtApp1.Launch
end if
qtApp1.Visible = True '
qtApp1.Options.Run.RunMode = "Fast"
qtApp1.Options.Run.ViewResults = True
qtApp1.Open "D:\Test2"
qtApp1.Test.Run
qtApp1.Quit
set qtApp1=Nothing



RE: execute tests using VB Script - sahithiqtp - 07-26-2011

Thanks Rajpes!

If i kill the QTPro process then the current QTP application that runs this script also dies. I tried killing QT automation agent but of no use. Also one thing I forgot to mention that I am currently connected to a remote machine and using QTP application there. The scripts are also in the same remote machine. Not sure if this has any impact


RE: execute tests using VB Script - rajpes - 07-27-2011

No idea,try restarting that remote machine