Micro Focus QTP (UFT) Forums
associate vbs - 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: associate vbs (/Thread-associate-vbs)



associate vbs - learner1 - 09-20-2010

Hi
can we associte vbs at runtime
basicaly my requirement is to implement case statement
case select var
case "A"
associate vbs a
case "B"
associate vbs b
end select

i dont want to use executefile as it does not provide ood debugging mechansm and also on some error it points to some other line of the code

also associating vbs using test->settings (manully) => loads all vbs at before the actual code execution start and makes us wait for long


RE: associate vbs - rajeshwar - 09-29-2010

Hi,

If you want to associate vbs before the QTP Application is launched, you can do it in following way.

Code:
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.Test.Settings.Resources.Libraries.RemoveAll
var  = "A"
Select case var
    case "A":App.Test.Settings.Resources.Libraries.Add "D:\A.vbs"
    case "B":App.Test.Settings.Resources.Libraries.Add "D:\b.vbs"
End Select
Set App = Nothing



RE: associate vbs - Ankur - 09-29-2010

This functionality is added in QTP 11 now Check the new features of QTP 11 here