Ask a Question

Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

SOLVED
DeepikaRamasamy
New Contributor

Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi All,


We are trying to centralising the Testcomplete Framework (Python Code with in-built methods of Testcomplete) outside the Testcomplete Editor in-order to implement "Central Repository" similar to Maven Dependency for Java. 

 

Kindly let me know if anyone has implemented Centralising the Framework and use it as a Dependency in the Testcomplete Project.

 

Please assist me on how to centralising the Framework Code & access testcomplete in-built methods. 

 

Much appreciated for your help in advanced.

 

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi,

 

I am sorry but this will not work either.

Test Project in TestComplete is the primary and self-containing entity in TestComplete. Everything that is required for test execution must be a part of this given test project.

Components of test project (script units, keyword tests, ...) can be located in project's subfolders or as external items, but must be explicitly included in the project.

Project suite is just a container to unite one or more test projects and to make it possible to run more than one project in one go. The only possible data exchange between projects that are part of some project suite is via Suite Variables.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

7 REPLIES 7
AlexKaras
Community Hero

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

HI,

 

Not sure what you are trying to get... Some sample example might help.

Obviously, TestComplete's methods cannot be used without TestComplete/TestExecute.

And script files can be stored within any repository.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
DeepikaRamasamy
New Contributor

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi @AlexKaras,

Thanks for your response. 

 

We are trying to achieve ‘Centralising the Framework (Common / Re-usable code)’ in some Repository (Git / Shared Path / Nexus as a Python Package) in-order to be used as a dependency for Multiple projects.

 

Note: This is similar to Maven Dependency for Java Project, we are looking forward to move the Framework layer outside Testcomplete Project. By setting the Path of Common code as a Sys Path, trying to execute Script inside Testcomplete / TestExecute.

 

Can you suggest how can we achieve this, we tried the below approach

 

Steps we tried:

 

  • - Placed the Framework (Common Code) outside the Testcomplete Project (Testcomplete Editor)
  • - Inside Testcomplete imported the Framework (Common code) in-order to Execute one of the TestCase (Eg: Click on the Tab in the application)

Please find the Approach.png file for more info

 

Challenges:

  • - Able to access Common Code, but some of the Testcomplete related in-built methods like ‘aqObject , Delay, Log etc.,’ are not accessible (Since Framework / Common code is kept outside Testcomplete)
  • - Receiving an Error "NameError : name 'aqObject' is not defined"

 

 

Kindly let me know is there any better way to achieve ‘Centralising the Framework’

 

Much Appreciated for your help in advance.

 

Thanks. 

AlexKaras
Community Hero

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi,

 

Still not sure what exactly and what for you are trying to get.

Components of TestComplete project (script units, keyword tests, etc.) can be located at any location within your network and can be added to any TestComplete project via the Add Existing Item functionality. So you can organize all your reusable code/entities into some standalone folder and reference required items from this folder into your projects.

Test code that uses TestComplete's internal objects can be used from within TestComplete only. Likewise Java code can be used only with Java runtime.

You must explicitly add required resources (script units, keyword tests, unit tests, etc.) to test project.

 

 

> - Receiving an Error "NameError : name 'aqObject' is not defined"

Can you provide a screenshot of TestComplete (screenshot of the whole application) at the moment when the error occurs?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
DeepikaRamasamy
New Contributor

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi @AlexKaras 

 

Many Thanks for your instant response.

 

Many of our Testcomplete projects shares the common-code / Framework, so we are trying to keep the code outside the Testcomplete Editor. 

 

We don’t want to Add the Common Code inside the Testcomplete Editor (“Add -> Existing Item”) and should be able to access the common code similar to python packages or Java Libraries. 

 

Background: 

Since multiple project shares the common-code / Framework, people are making changes to Framework code & its changing over-time for different Project. We want to avoid people making changes to Framework code / Common-code in-order to maintain the Single Framework code. 

 

Thus planning to keep the Framework code outside TestComplete Editor and trying to execute the Framework code without even “Add -> Existing Item”.

 

Note: 

We are trying to achieve similar approach as Python Packages (Eg: OpenPyxl), we can keep the package inside Testcomplete Project -> Externals & can use it in Testcomplete even without “Add -> Existing Item”, by simply setting the Path of the package using “sys path insert”. 

 

Similarly When we tried to Kept Framework code / Common-code outside the Testcomplete Project / Editor, we are able to access the code. But its failing while trying to execute Testcomplete related methods/code such “aqObject, Delay, Log”, since this is not Python Related code. 

 

Code Snippet:

1_code.png

 

Error: 

2_error.png

 

Much Appreciated for your help in advance. 

 

Thanks,

Deepika. 

AlexKaras
Community Hero

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi,

 

trying to execute the Framework code without even “Add -> Existing Item”

This will not work just because TestComplete-specific code (built-in objects, etc.) must be executed from within TestComplete. In this case TestComplete executes its internal code for built-in objects and passes script language specific code to the corresponding scripting language (Python runtime in your case).

Otherwise, you may surround all lines with TestComplete-specific code into some conditional statements/defines/etc. whatever is supported by the target scripting language to exclude such lines from been executed during runtime. Not sure that this is practically-reasonable option.

What you are essentially trying to do is to reverse existing architecture. Currently, TestComplete is a driving application that executes its specific test code and passes scripting language specific code to the corresponding scripting runtime. You are trying to make a scripting language runtime to be a driving application that calls TestComplete when execution of TestComplete-specific code is required. This is a concept of Connected Application that existed in TestComplete previously but is going to be deprecated now. Besides this, I am far not sure that Connected Application can be created/used from scripting language.

 

Otherwise, your idea is absolutely correct and this is one of the recommended best practices to have a reusable common code that is shared between different test projects.

 

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
DeepikaRamasamy
New Contributor

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi @AlexKaras 

 

Thank you so much for your detailed Explanation. 

 

Since this is not possible to keep Testcomplete in-built methods outside of Testcomplete editor.

 

We have an alternative approach to achieve this, kindly suggest wether this is possible or if you have any other solution to centralise the common-code / Framework code outside of Testcomplete Project/ Editor but as a different project inside the single Project Suite. 

 

Alternative Approach:

 

  • Trying to create single Project Suite with 2 different Project (TestCase_Projec & Framework_Project). 
  • Inside TestCase_Project only the Testcase related codes & in the second Project Framework_Project all the framework related code (But it will be inside the Single Project Suite).

 

Is it possible to call the python methods (which contains Testcomplete in-built methods) from one project to another project without adding them as an Existing One (Add -> Existing Item of Framework_Project ) in the TestCase_Project

 

Much appreciated for your help in advanced.

 

Thanks.

AlexKaras
Community Hero

Re: Integrate Testcomplete (Python) Core Framework with Nexus / JFrog Artifactory Repository

Hi,

 

I am sorry but this will not work either.

Test Project in TestComplete is the primary and self-containing entity in TestComplete. Everything that is required for test execution must be a part of this given test project.

Components of test project (script units, keyword tests, ...) can be located in project's subfolders or as external items, but must be explicitly included in the project.

Project suite is just a container to unite one or more test projects and to make it possible to run more than one project in one go. The only possible data exchange between projects that are part of some project suite is via Suite Variables.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: