TestProject Forum

Copying test from one project to another duplicates tests & elements [OPEN]

Hi there,

Our team have been using TestProject for a while now. When planning how we will organise things, we decided to have a Sandbox project where we work on creating automation tests and then a Web project, which has all of our completed tests. The idea here is that we work on creating a test in Sandbox and once it has been reviewed by a peer and deemed good, we copy it to the Web project. This is so devs etc who do not work on creating tests, know that they can run any test they like in the Web project.

My issue is that I have run into several problems copying a test from one project to another.

Firstly, if my test calls another test, then both of these tests get copied over. For example lets say I have a test called CheckWeather:

Test Step 1: Run Login test
Test Step 2: Get figure from weather element

Now if I copied CheckWeather from Sandbox project to Web project what would happen is that two new tests are created in Web project, Login and CheckWeather. Web project already has the test Login and instead of seeing this and reusing that test, it has created a new Login test with a random id. This is very frustrating as it means I need to go edit the CheckWeather test to use the existing Login test, not the new one and then go back and delete the new Login test that was created.

This is a simple example but most of my tests are more complicated than that. For example I had a test with 30 steps and each step had a recovery test. Once it was copied to another project I then had to go in and edit all 30 steps to use the existing recovery tests, not the new ones that were automatically created.

I understand that may be a feature request but the main issue I have copying tests from one project to another is elements, and I think this is a bug.

When I copy a test from one project to another, it creates all new elements. All with the same names.

For example I have three different tests, all three tests use some of the same elements. But once I copied these tests from Sandbox project to Web project, it created three duplicate elements. Here is a screenshot of one of these examples:

You can see here, the ids and the names are identical. And I have no way of knowing which element belongs to which test.

If I were to manually create an element, it would not allow me to create an element with the same name, for example:

So this appears to be a bug. If I edit one element, the others are not updated so they don’t seem to be linked in any way.

I now have over 100 elements that have been duplicated three times and it will probably take me hours to go through all my tests and edit them to make sure they are all reusing one element.

The ideal scenario would be that when you copy a test from one project to another, that it reuses existing tests with the same name and reuses existing elements with the same name.

Hi @hazel.egan_testproje,
We recommend using a folder as a sandbox in the same project that you working on,
To avoid having to change tests manually, regarding the elements I’ve opened a ticket to change this behavior (TP-16466) and I will let you know once this gets resolved.

1 Like

That’s great, thanks Amit!

Hi @hazel.egan_testproje
The issue has been identified and has been resolved, it will not work on existing duplications but should work from now on.
Elements with same name and the same type will be joined.
Elements with the same name and different type will added as copy of…
Let me know if there is any issue.