Forum Discussion
Thanks for your reply Marsha_R.
I couldn't find a way to resolve this issue quickly so I had to revert back to using the existing project for what I wanted to do. It was a bit of a pain but not major.
I did have a side effect issue caused by sharing the test with the other project suite which I am more concerned about. When I tried to run the test I had shared from it's parent project it would not run for the same reason. When I looked closer the Value had changed and now included odd full stops where it didn't before. For example,
aqConvert.DateTimeToFormatStr(aqDateTime.AddDays(aqDateTime.Today, 1), "%d%m%Y")
became something like
aqConvert.DateTimeToFormatStr.(aqDateTime.AddDays(aqDateTime.Today,. 1),. "%d%m%Y")
So, basically, by sharing the test with another project I had inadvertantly broken the test! To resolve I had to manually amend and take out the random full stops, thankfully I hadn't shared many.
Any idea why this happened? I would like to share tests between projects and project suites, so I would be interested to know so that I can make sure this doesn't occur.
Many thanks,
Jenny
What it sounds like is converstion.
When you create a project in TestComplete, one of the things you select is the code language for the project (JavaScript, DelphiScript, etc). Even if you're using only keyword tests, there is some aspect of that which uses that code language (code expressions, code snippets, etc).
So, if Project A was created for one language and Project B was created for another language, when you added stuff from A into B, a conversion most likely took place of those portions that are code dependant.
This MAY actually be the cause of your first problem, that when you added your items to Project B, they converted improperly (or didn't convert at all) and hence wouldn't run in the new project.
- JennyH117 years agoFrequent Contributor
Hi tristaanogre!
You're a star! I think you've hit the nail on the head. Each project uses a different coding language, one VBScript, the other Python.
So, I have my answer. If I want to share between projects use the same coding language as the project I'm sharing the test from and this issue shouldn't occur.
I am successfully sharing one test from a VBScript project to a DelphiScript project currently and apart from an object mismatch between the two projects have not seen any issues. Perhaps the issue is specifically with conversion between VBScript to Python? Just a thought.
Thanks for your help tristaanogre!
- tristaanogre7 years agoEsteemed Contributor
I'm not sure how it's working with sharing VBScript project with DelphiScript. Could be that you don't have any code-snippets to update or such.
But yeah, if you're going to share stuff between projects, it's best to make sure that each project has the same code language.
- tristaanogre7 years agoEsteemed Contributor
Out of curiousity... why are you writing automation in so many different code languages? There really is no technical need to do so... you can test Delphi applications using JavaScript automation and web applications using DelphiScript. The code language of the automation project does not need to match the language of the application under test...
- tristaanogre7 years agoEsteemed Contributor
BTW.... an alternative to sharing project pieces between projects, especially if you need to have projects in different languages, is to investigate Script Extensions.
Script Extensions allow you to write script language code (either JScript or VBScript) to perform functions and actions within your test without having to share components between projects. They are also language independant. I can write a Script extension in JScript (a language I'm familiar with) and make it available to anyone using TestComplete and they can utilize the script extension even if they are using VBScript or something else. So, if there is a need to share certain code across projects with different languages, this may provide at least a partial solution.