This is a migrated thread and some comments may be shown as answers.

Independent elements?

5 Answers 151 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mark N.
Top achievements
Rank 1
Mark N. asked on 05 Jun 2013, 10:20 PM
Hi,

I've noticed that when I select an element in the Elements pane, right-click and choose "Used By", the dialog that comes up sometimes shows me that the chosen element is "# Independent #" in some script files.  Can someone tell me what this means?

When i change the Elements pane to show only the elements used in this script, the independent ones appear, along with the ones actually referenced by the script steps, for certain files.  Is the any way to remove them from these script files?

Thanks,

-Mark

5 Answers, 1 is accepted

Sort by
0
Boyan Boev
Telerik team
answered on 06 Jun 2013, 01:21 PM
Hello Mark,

"#Independent#" appears when you convert a recorded step into a coded one. Test Studio knows that the element refers to the particular test, however it doesn't know in which test the step is used.

That is the reason you cannot remove them.

Should you have any additional questions please do not hesitate to ask us.

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Mark N.
Top achievements
Rank 1
answered on 06 Jun 2013, 02:02 PM
Thanks, Boyan.  I've noticed that, if an element is marked #Independent#, and I change other, recorded steps to *not* use the element, I can see multiple "# Independent #" entries in the Used By dialog for that script.  Is that also normal?

And if I'm sure that I've removed all steps (recorded and coded) which referred to that element, is there a way to remove it from that script?  For example, I recorded a step using an element from the wrong page.  I've added the correct element to the project, and I changed the reference in the step to the new element.  If the element is reported as #Independent#, I can't right-click on it and select Delete -- it's disabled.

Is there any information about this in the help system?  I used the Search feature, but found nothing relevant.

Regards,

-Mark
0
Boyan Boev
Telerik team
answered on 06 Jun 2013, 02:29 PM
Hi Mark,

Yes this is an expected behavior. 

After converting the step from recorded to a coded one Test Studio looses the connection between the element and the step. Therefore deleting all the steps don't delete "#independent#".

Test Studio simply doesn't know if the element is used or not by some step.

When you delete all steps you can simply delete the elements also.

Hope this helps.

Regards,

Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
Mark N.
Top achievements
Rank 1
answered on 06 Jun 2013, 03:12 PM
Hi Boyan,

Well, I can't always delete the element, because I have other scripts referencing it.  As long as one script is using the element, it still shows up as #Independent# in all of the scripts where it was removed, and can't be deleted.

I've found the independent element's XML definitions in the script .tstest files (IndependentDescriptors tag).  Not that I would advocate it, but would it harm anything to just edit that file and delete the independent element definitions?  (I'm just trying to be tidy. :-)

Speaking of elements, where are they normally stored?  If it's in the file where they were first recorded, is there any way to move their definition from one file to another?

-Mark
0
Boyan Boev
Telerik team
answered on 07 Jun 2013, 03:02 PM
Hello Mark,

You can modify the XML in а way you want. You can delete the elements. However we do not recommend to modify the XML file manually. This can corrupt the entire test. 

Manually editing the XML file is at your own risk.

Regarding how the elements are stored please check out this article.

Thank you for your understanding.

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
Tags
General Discussions
Asked by
Mark N.
Top achievements
Rank 1
Answers by
Boyan Boev
Telerik team
Mark N.
Top achievements
Rank 1
Share this question
or