Micro Focus QTP (UFT) Forums
Can we associate the required addins at run time? - 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: Can we associate the required addins at run time? (/Thread-Can-we-associate-the-required-addins-at-run-time)



Can we associate the required addins at run time? - Pallavi - 07-21-2011

Hi All,

Our older versions of our application is developed using activex,VB,.net and Web
We have our new product version which is developed using activex,VB,.net and Web and WPF
That is the main gateway screen is developed using 'WPH' so the test needs 'WPF' Addin also to be associated with other Addins
If we associate this to the test permanently, then it may not work for our older versions of our application which needs only activex,VB,.net and Web. We dont need to associate WPF when executing the same test on older versions of our application.
I am thinking to get the Application version installed in PC and use a If.. Condition statement and associate the required Addins.
So is there a way to associate the required Addins at run time based on our application version? Please let me know if there is a way to do that.

Thanks and Regards,
Pallavi



RE: Can we associate the required addins at run time? - rajpes - 07-21-2011

write the below script in a notepad, save it as .vbs , close qtp window, double click the vbs file.
Code:
set q=createobject("quicktest.application")
q.visible=true
msg="enter 1 for older version" &vbnewline &"2 for newer version"
op=inputbox(msg)
if op=1 then
addinlist=array("Web","ActiveX","Visual Basic")
elseif op=2 then
' I dont know about WPF addin, assuming the name is "WPF"
addinlist=array("Web","ActiveX","Visual Basic","WPF")
end if
q.setactiveaddins addinlist
q.launch
'path of test  folder
q.open "D:\MyTest"
q.test.run
set q=nothing
'Once you launch qtp with some add ins selected, you can not add a new add in at run time! by the way i wonder why you are selecting all the add ins!