Ask a Question

Getting error "NameError: name 'TestedApps' is not defined"

Mohit_Dadhich
Occasional Contributor

Getting error "NameError: name 'TestedApps' is not defined"

I am trying to launch my desktop application via TestedApps.Appname.Run() using UnitTesting(PyUnit)

But it is giving me error as "NameError: name 'TestedApps' is not defined"

Additonally, TestedApps.Appname.Run() is working fine if i am not using UnitTesting. It is working fine for simple Keyword Test and Script Test using Python language but when i executes it using Unit Testing(PyUnit) then it shows me the above error and application is not getting launched.

6 REPLIES 6
hkim5
Staff

Re: Getting error "NameError: name 'TestedApps' is not defined"

because the concept and the entity TestedApps is a TestComplete specific thing, so you cannot call on it from an external source like a UnitTest (pyunit)

--

there is no such thing as a module TestedApps that you can pip install and use

 

Best,
Justin Kim
Mohit_Dadhich
Occasional Contributor

Re: Getting error "NameError: name 'TestedApps' is not defined"

so how can i launch my application using PyUnit

hkim5
Staff

Re: Getting error "NameError: name 'TestedApps' is not defined"

Mohit_Dadhich
Occasional Contributor

Re: Getting error "NameError: name 'TestedApps' is not defined"

Yes it's working fine thanks, now i am able to launch my application through subprocess.call()

Also Am i be able to work on my application through the scripts i have created using TestComplete script tests in PyUnit module?

For ex - Need to login into the application and verify the logged in user. For this i have created a keyword test using python. But i want to execute it via PyUnit so is it possible?

hkim5
Staff

Re: Getting error "NameError: name 'TestedApps' is not defined"

no thats not possible

kdt can only be ran via testcomplete or testexecute

Best,
Justin Kim
Mohit_Dadhich
Occasional Contributor

Re: Getting error "NameError: name 'TestedApps' is not defined"

Ok Thanks for the information..

Am i be able to work on my application through the Scripts Test i have created using TestComplete script tests in python language and i want to run it through PyUnit?

Scripts is created for logging into the application and verification. Does PyUnit support the objects and methods of TestComplete?

cancel
Showing results for 
Search instead for 
Did you mean: