Forum Discussion

SanM's avatar
SanM
Occasional Contributor
8 years ago

How to run just the script file in Test Complete 11

New to TC and learning in progress:smileywink:

 

I have created the python script file in the project and I want to run the script file to check whether it works or not.

 

To do that I was trying to add the script file in project test item as shown in the attachment but I couldn't do that. Also, I was trying to run just the script file but I could see the Run Script Button is disabled after defining the class A in script (Refer attached screens shot)

 

Should I do something else to make it work or I am on the wrong way?

 

Please suggest.

 

  • baxatob's avatar
    baxatob
    Community Hero

    Hi!

     

    You can not call class methods as project items.

     

    If you really need it, you can do following:

     

    class A:
        def class_method():
            Log.Message("class A method")
    
    
    def root_method():
        A.class_method()

    Now you can add root_method as a test item.

     

    Also you can use separate project scripts instead of classes.