I would like to hear your "best-practice" apprroach regarding this...
I have various applications under testing process. Java, Oracle, WPF, Web, etc...
I do not wish to launch UFT with all of these addins loaded. It is not correct to do.
What I wish to create is a mechanism, that will decide what to do according to what's happening now. See what addins are loaded, see what is required for the test and decide what to do..!!
I need to hear what is your idea regarding this. Since UFT cannot load addins in runtime, I need to create something that will launch UFT with only the correct addins...:
I call this function from my test:
ret_addins = Verify_AddIns(Environment("TestDir"), missing_addins)
If (ret_addins = -1) Then
msgbox "The following add-ins are missing :" &vbcrlf& missing_addins, 16, "Missing Addins"
Function Verify_AddIns(test_name, missing_resources)
Set qtApp = CreateObject("quicktest.application")
' Create an array containing the list of addins associated with this test
arrTestAddins = qtApp.GetAssociatedAddinsForTest(test_name)
' Check if all required add-ins are all already loaded
blnNeedChangeAddins = False ' Assume no change is necessary
missing_addins = ""
For Each testAddin In arrTestAddins ' Iterate over the test's associated add-ins list
addin_status = qtApp.Addins(testAddin).Status
If (addin_status <> "Active") Then ' If an associated add-in is not loaded
print("The Add-In : " & testAddin & " is NOT LOADED with UFT. Test will now abort !")
blnNeedChangeAddins = True ' Indicate that a change in the loaded add-ins is necessary
missing_addins = missing_addins & testAddin & " "
' Exit condition if add-ins need to be changed.
If (blnNeedChangeAddins) then
print("Missing add-ins in UFT : " & missing_addins)
Reporter.ReportHtmlEvent micFail, "Missing Add-Ins in UFT", "These Add-Ins were not loaded with UFT : " & missing_addins
Verify_AddIns = -1
missing_resources = missing_addins
Verify_AddIns = 0
So far goes for the decision point.
Now, how would you suggest I do for the modification of the add-ins...?
This is the command that can load the add-ins however this could be done before UFT starts.
ret_load_addins = qt_app.SetActiveAddins(arrTestAddins, err_desc)
So what is your suggestion on this topic..??