Independent elements?

6 posts, 0 answers
  1. Mark N.
    Mark N. avatar
    6 posts
    Member since:
    Mar 2013

    Posted 05 Jun 2013 Link to this post

    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
  2. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 06 Jun 2013 Link to this post

    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!
  3. Mark N.
    Mark N. avatar
    6 posts
    Member since:
    Mar 2013

    Posted 06 Jun 2013 Link to this post

    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
  4. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 06 Jun 2013 Link to this post

    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!
  5. Mark N.
    Mark N. avatar
    6 posts
    Member since:
    Mar 2013

    Posted 06 Jun 2013 Link to this post

    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
  6. Boyan Boev
    Admin
    Boyan Boev avatar
    1072 posts

    Posted 07 Jun 2013 Link to this post

    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!
Back to Top