Last Updated: 07 Jan 2015 12:34 by ADMIN
Velin Koychev
Created on: 08 Apr 2013 09:05
Type: Feature Request
Deleting steps delete elements in the Elements Explorer that are already used in Coded steps
Deleting steps delete elements in the Elements Explorer that are already used in Coded steps.

Steps to reproduce:

1. Create a simple test that includes a step that selects one element. This element will be visible in the Elements Explorer.
2. Add a coded step that uses the same element. 
3. Select the the first step that adds the element in the Elements Explorer and delete it.

Actual: Compilation fails. The element that is used in the coded step is no longer in the Elements Explorer.
Expected: Test passes .
Konstantin Petkov
Posted on: 07 Jan 2015 12:34
Just a follow up -- the mentioned updates does not address the exact scenario from the description, however a work-around is to convert a recorded step (using the particular element) to code instead of adding a new coded step. That will add a "shadow" reference of the element linking it to the active test so that deleting the recorded step will leave the element to the repository. Such an "independent" (from test steps) element can be manually deleted however that will at least warn the user the element reference may be used in code (this warning is added for the next release).

Hope this helps!
Konstantin Petkov
Posted on: 02 Jan 2015 12:36
Working on a couple of improvements in this area - those "independent" elements (out of recorded steps) can support UsedBy and Delete commands in the Elements Explorer. Allowing Delete we point the user to the related tests and also warn this can cause project compilation to fail.

Cheers and Happy New Year!
Konstantin Petkov
Posted on: 25 Apr 2013 08:02
That sounds like a cool idea, David, thanks! That will serve as a nice code protection in case you care about maintaining your code of course.

I've seen big projects with tons of code referring elements though and it will be quite time consuming to protect all your elements this way. Still better than nothing I guess.

Thanks for the feedback!
Posted on: 24 Apr 2013 15:42
This one has caused me some grief in the past, it happens a lot when you are refactoring the elements or a test and when it happens can be difficult to recover from.

I understand it would be difficult to parse the coded steps to find the elements in use, but you might give the user a special comment syntax (or something like that) where you could declare the element being used and this would tip off the IDE no to delete the element....
Konstantin Petkov
Posted on: 19 Apr 2013 13:25
Unfortunately Test Studio loses the relation between the element and the code as soon as one converts a step to code for example. Test Studio can only detect if an element is used in a recorded step . One can run into similar problem if for example rename the element used in the code as well.

This is a limitation of the code service in use by Test Studio Standalone since V1. Hopefully one day we can improve the code service to be able to deal with the elements repository as well.

I'm sorry for any similar troubles caused by this limitation!