Script Extension property returning error in Python script
I'm having issues with a script extension I wrote in VBScript and am trying to use in a Python script. The extension works fine from within a VBScript test. I'm running TestComplete12.30.
def MyTestFunction():
MyResult = AEWeb.NavItemVisible("Views", "Active Process Information")
I've also tried:
MyResult = str(AEWeb.NavItemVisible("Views", "Active Process Information"))
The NavItemVisible property simply returns True or False boolean (but as a Variant because that's what VBScript returns).
The error I receive for both versions of the call above is:
TypeError
'IDispatchIndexedPropertyWrapper' object is not callable
Error location:
Unit: "ResMan6.0\WebUI2\Script\Views"
Line: 3473 Column: 1.
Thoughts or help would be greatly appreciated.
I believe you need to use the https://support.smartbear.com/testcomplete/docs/reference/language/python/getprop-method.html
It's similar to the JavaScript $get method. The reason being is that what is being returned is being returned as a COM object...
Just verifying... NavItemVisible is a property, not a method in your Script Extension, correct?
If it is a property, your syntax should be
def MyTestFunction():
MyResult = AEWeb.__getprop__("NavItemVisible", "Views", "Active Process Information")
See the section here https://support.smartbear.com/testcomplete/docs/scripting/specifics/python.html about using parameterized properties.