Forum Discussion

DKumar04's avatar
DKumar04
Contributor
6 years ago

Go to Declaration and Find usages options not working

Hi,

I am currently facing two problems inside script editor in TestComplete 14.10,

Problem 1:

Go To Declaration shown disabled in script routine's context-menu when the routines was actually written inside the class

For ex:

In unit1.py

 

class test:

   def method1():

        Log.Message("Hello World")

 

In unit2.py

 

from unit1 import test



def sampletest():

    test.method1()- right click on 'method1()' and see the option 'Go to Declaration' shown disabled, aslo Ctrl clicks not working

 

Problem 2:

Find usages not working for methods inside class

consider the same above example,

right click on 'method1()' inside class 'test' in unit1.py

Click on 'Find Usages' - nothing returns, but that method actually used in unit2.py 

 

 

 

 

  • While you can use classes in Python in TestComplete, TestComplete is not designed to be a full development IDE of Python.  You are writing Python script, not full Python, so the parsing and inclusion of things is a bit different.  

    Technically speaking, you don't need the class at all.  If you pull Method1 out into just a method function without a class and import the method, it will work just the same.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    While you can use classes in Python in TestComplete, TestComplete is not designed to be a full development IDE of Python.  You are writing Python script, not full Python, so the parsing and inclusion of things is a bit different.  

    Technically speaking, you don't need the class at all.  If you pull Method1 out into just a method function without a class and import the method, it will work just the same.