Forum Discussion

hisense's avatar
Occasional Contributor
5 years ago

Can NOT use python Code Completion

How can I enable Python built-in method code completion in TestComplete Code Editor?So far,It just pop up TestComplete built-in things.

6 Replies

  • tristaanogre's avatar
    Esteemed Contributor

    What are you trying to do in the way of code completion?  Some code sample would be helpful.  The reason I ask is that there are certain things that may not be able to popup in "intellisense".  Methods within classes, for example.  While I know that the "standard" practice with Python is to write classes and such, that is not necessary with TestComplete Python scripting so you can define your methods and such without needing to be in a class.

  • hisense's avatar
    Occasional Contributor
    robert for example, Step1:I defind a list with python script. lst = [1,2,3,4] Step2:I input "lst." in code editor,if i am using "pycharm",it will pop up the below screenshot and it will show the native function.But NOT in testcomplete code editor
    • Lagencie's avatar
      Frequent Contributor

      Can only agree to this


      IntelliSense does not work at all with python. It works for the TestComplete internal stuff like Project.Variables.... but not for python code in either forms.


      newVariable = "test"

      gives you not a single option with newVariable.  (either pressing CTRL + SPACE , nor automatically)


      same goes for other things like the mentioned list or even things like:


      import re
      escapedRegex = re.escape("Test%#$@manual")

      gives no option when pressing re.     but it works in the end, but you have to either write the code in another editor or know exactly what to write.

      • tristaanogre's avatar
        Esteemed Contributor

        Just an additional note, this is the same for any language used by TestComplete.  It is the nature of the tool, really.  You can write and execute code in particular languages, however, the parser and underlying compiler are only present in runtime.  


        For example, take the below JavaScript


        function boo(){
            var me;
            me = 'Testing';

        If you type me. nothing weill come up.  In JavaScript compilers, you may get something like "length" or "indexOf" or similar things.  TestComplete will not display these because it is not anative JavaScript compiler. 


        Again, keep in mind the nature of what TestComplete is.  It is not an application compiler.  It is a test automation tool which allows you to use a variety of languages for writing scripts for execution.  But, at it's core, it's a test automation tool.