Menu Bar of the blog

Monday, 3 November 2014

UFT Code#2: To execute UFT from a .vbs file

As explained in earlier posts, a .vbs file can be used to perfrom any operation on Windows like, handling a Windows application or working on a browser or running a UFT script.
To invoke and run a particular test on UFT, from an External vbs file:-
  1. Copy the below function in a notepad and save the file with .vbs extension.
  2. To run the program, double click the saved .vbs file.
runTestOnUFT()
 Function runTestOnUFT()
 set qtApp = CreateObject("QuickTest.Application")
 qtApp.Launch
 qtApp.Visible =True
 qtApp.Open <projectPath>
 Set qtTest = qtApp.Test
 qtTest.Run
 qtTest.Save
 qtTest.Close
 qtApp.quit
End Function


====================*************************************====================

No comments:

Post a Comment