How to batch change Finding Element Logic

3 posts, 0 answers
  1. Eddie
    Eddie avatar
    4 posts
    Member since:
    Dec 2013

    Posted 01 Nov 2015 Link to this post

    Is there any suggestions to batch change finding element logic?

     For example, there is a logic of finding a element with XamlTag=fldatagrid, but I want to change XamlTag=fldatagrid to  XamlTag=fldatagrid_V122.


    So how can I change this logic in all test?

  2. Sailaja
    Sailaja avatar
    7 posts
    Member since:
    Dec 2014

    Posted 02 Nov 2015 Link to this post

    Hi Eddie,

    There are two ways where you store the element. One, using Elements tab. Second, when element find logic is identified using Telerik Framework. Later one depends on how flexible is our framework.

    Steps to edit Find Logic when Element is stored in Element Explorer.

    1. Navigate to Element Explorer tab.
    2. Right click on the element for which you want to change the findlogic
    3. ​Choose Edit in Live in TTS.
    4. ​In Find Element dialog, ​under Find Settings section, change the XamlTag value from fldatagrid to fldatagrid_V122
    5. Once you confirm that the element is identified properly, you can save the logic.
    6. If the modified element is used by multiple automation steps, you will be prompted to select the steps you want to persist changes to.

    If element is retrieved using ​script/coded step, then manually change the places where ever you use this.

    Tip: If you are trying to retrieve elements using script/coded step, then maintain all the elements find logic in one class file and refer them in your test cases. If you follow this way, like in your scenario, if you just modify the find logic in one place, it reflects the logic in all the corresponding places where ever you refer it.


    namespace automation

        public class element{

         String LoginNowlink = "tagname=a,TextContent=Login Now";



     Now if the link name is changed to Login instead of Login Now, then you just need to replace the below line and save the class

         String LoginNowlink = "tagname=a,TextContent=Login"; 


    Hope this information helps you




  3. Ivaylo
    Ivaylo avatar
    775 posts

    Posted 05 Nov 2015 Link to this post

    Hello Eddie,

    As Sailaja already explained, feel free to edit the element's find logic and save it. Test Studio will automatically detect all the tests that this elements is used in and will update them accordingly.

    @Sailaja Thank you for assisting in public forums. I have updated your telerik points.

    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top