Forum Discussion

maheshpandense's avatar
3 years ago

FindChild() does not work when selected python as the scripting language but works for VB Script

I am using TestComplete v14.20

I have a code in both Python and VB Script.

The findChild code works perfectly fine with VB Script and finds based on the property "idStr". But the same doesnt work with Python.

Syntactically the code is correct but in Python it fails to find the element based on the property "idStr.


I am required to use the same property.

VB Code:

arrProperties = Array("idStr")
arrValues = Array(strRole & "_" & strPrivilege)
intSearchDepth = 10

Set Privileges_GetPrivilegeToggle = objPrivilegesTable.FindChild(arrProperties, arrValues, intSearchDepth)


Python code:

arrProperties = ["idStr"]
arrValues = [strRole + "_" + strPrivilege]
intSearchDepth = 2000
fn_return_value = objPrivilegesTable.FindChildEx(arrProperties, arrValues, intSearchDepth)


In VB it finds the child Privilege Toggle but in Python TestComplete doesnt.

Any solution?

I tried using variables instead of array as there is only single property and value, still it doesnt work.