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

How to batch change Finding Element Logic

2 Answers 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eddie
Top achievements
Rank 1
Eddie asked on 02 Nov 2015, 03:42 AM

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 Answers, 1 is accepted

Sort by
0
Sailaja
Top achievements
Rank 1
answered on 03 Nov 2015, 05:30 AM

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.

Example

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

Thanks,

Sailaja

 

0
Ivaylo
Telerik team
answered on 05 Nov 2015, 06:44 AM
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.


Regards,
Ivaylo
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Eddie
Top achievements
Rank 1
Answers by
Sailaja
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or