Forum Discussion

Xavi's avatar
Xavi
Occasional Contributor
3 days ago

Issues upgrading from 15.7 to 15.8 version

Dear,

After upgrade TestComplete from 15.7 to 15.8 version, some issues appeared.

     Python runtime error - NameError: name 'Aliases' is not defined
     Python runtime error - NameError: name 'Log' is not defined
     Python runtime error - NameError: name 'Project' is not defined
     Python runtime error - NameError: name 'aqObject' is not defined
     Python runtime error - NameError: name 'ADO' is not defined

The support team suggested us to add this header line to all the project scripts:

     from tc import *

And to add this prefix:

     tc.Aliases.Client ...
     tc.Log.Message(...)
     tc.aqObject.GetVarType(ColumnId)
     tc.ADO.CreateADOQuery()

But, this solutions not resolves the issues.

Has someone had the same problem in order to help us ?

Thanks, Xavi

7 Replies

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    The latest version of TestComplete comes with Python 3.13. Python has made a number of changes. One of them is treating global as regular scoped objects, which has impacted Python scripts used in TestComplete.

    See https://support.smartbear.com/testcomplete/docs/scripting/specifics/python_tc_globalobjects.html for more information. You need to update your Python scripts to accommodate this change.

    As an example, Log is being passed as a parameter -

    MainTest.py

    import MyFunctions
    
    def main():
      MyFunctions.greet(Log, "Alice")

    MyFunctions.py

    def greet(Log, name):
      Log.Message(f"Hello, {name}!")

    Same issue has been discussed here, 

    TestComplete 15.77 is broken - dont upgrade | SmartBear Community 

     

     

      • mcpm's avatar
        mcpm
        Occasional Contributor

        I had a similar issue to yours, and our project is too big to pass these keywords to the function, but using "from tc import Log, Aliases" works for me. However, I came across another issue:

        https://community.smartbear.com/discussions/testcomplete-questions/logging-issue-on-tc-15-80-python-scripts/279683

  • mcpm's avatar
    mcpm
    Occasional Contributor

    Hello, this way:
    from tc import *
    also didn’t work for me, but try this:


    from tc import Aliases, Log, ADO

    and so on. 

    Then:
    Aliases.Client(...) 
    Log.Message(...) 

    If you want to try it this way (but I didn't use that): 
    tc.Aliases.Client(...),


    you need to import the namespace first:
    import tc

    I hope it helps
    Paweł

    • Xavi's avatar
      Xavi
      Occasional Contributor

      Hello,

      I tried you suggested solution, but it crashes on the header imports, maybe something wrong for my self ?

      Thanks, Xavi