cancel
Showing results for 
Search instead for 
Did you mean: 

Can we access the variables or objects in TestComplete from nunit Test

SOLVED
Occasional Contributor

Can we access the variables or objects in TestComplete from nunit Test

I am automating rest webservices in c# using nunit framework. Now I want to get the response in variable in my test complete Project. Currently , when I execute the nunit test through Test Complete, It just return the true status. I am wondering if there is any way that i can get access to variable of my nunit test in TestComplete? or i can access the Project variable of TestComplete project in Visual Studio so that i can set the variable with results in nunit test? Please Help!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Contributor

Re: Can we access the variables or objects in TestComplete from nunit Test

There is no way to access TC variables from the unit test. The best way I think is to write values into files and then read it by TC script.

Occasional Contributor

Re: Can we access the variables or objects in TestComplete from nunit Test

I exported API response in text file through nunit test and import it in test complete. It worked for me.

7 REPLIES 7
Contributor

Re: Can we access the variables or objects in TestComplete from nunit Test

There is no way to access TC variables from the unit test. The best way I think is to write values into files and then read it by TC script.

Community Hero

Re: Can we access the variables or objects in TestComplete from nunit Test

To expand on @Bobik , generally speaking, running Unit tests via TestComplete is simply provided to give you a central execution point for your tests rather than having unit tests run in one tool and functional in another.  So, all that is supported is generally a way of executing.  Passing variables back and forth between the unit test and TestComplete automation will have to be done via some other vehicle, either via file, registry key, data table, etc.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Can we access the variables or objects in TestComplete from nunit Test

You can get access to TestComplete Project variables and ProjectSuite variables from NUnit tests in C# (Visual Studio).  You will need to instantiate the TestComplete Automation Server in C#, open the project and make changes to the variable object in the project using COM automation.

 

Cheers

Lino

Highlighted
Community Hero

Re: Can we access the variables or objects in TestComplete from nunit Test


@LinoTadros wrote:

You can get access to TestComplete Project variables and ProjectSuite variables from NUnit tests in C# (Visual Studio).  You will need to instantiate the TestComplete Automation Server in C#, open the project and make changes to the variable object in the project using COM automation.

 

Cheers

Lino


I think there's also an API now for TestComplete, typically accessed via TestLeft but you should be able to get to it from VisualStudio.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Manager

Re: Can we access the variables or objects in TestComplete from nunit Test

Community, thanks for your great suggestions!

 

@Amna_Saeed321, was the question answered? Please select the best answer as a solution or share your own solution.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Occasional Contributor

Re: Can we access the variables or objects in TestComplete from nunit Test

Thanks everyone for the help. much appreciated

Occasional Contributor

Re: Can we access the variables or objects in TestComplete from nunit Test

I exported API response in text file through nunit test and import it in test complete. It worked for me.

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors