App busy error while associating library file
I am trying to associate a library file at runtime to a test already opened in QTP.
But I am getting Application Busy error.Can not we associate library to script already open at runtime
Set qtLibraries = qtpApp.Test.Settings.Resources.Libraries ' Get the libraries collection object
If qtLibraries.Find("C:\Users\Dell\HP Quick Test Pro 10.0\Quick Test Pro 10.0\Quick Test Pro 10.0\OR\app_objects.vbs") = -1 Then ' If the library cannot be found in the collection
qtLibraries.Add "C:\Users\Dell\HP Quick Test Pro 10.0\Quick Test Pro 10.0\Quick Test Pro 10.0\OR\app_objects.vbs", 1 ' Add the library to the collection
Re: App busy error while associating library file
You can't use this method to add to the open test at runtime. That API is intended for an external vbs to manipulate scripts in mass and similar applications. To load a library at run time in QTP 10 you need to use ExecuteFile.
In version 11 they added the 'LoadFunctionLibrary' method.