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

Elements - Append dynamic data to find element

3 Answers 72 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 30 Jul 2020, 08:12 PM

Hello I was looking for what is the best approach to append a data driven value (from local data for example) to the end of an element locator.

For example I have an element (label) which is repeated and has the html attribute <....id=row##>.  The ## value increments from row 1 <label id=row01>....<label id=row10>

I wanted to see if there's an approach when providing the element locator expression I can do something like Id=row$(rownumber)

with rownumber being the datadriven variable.

The case for this would be to evaluate a specific row by test.

I have reviewed the following article - https://docs.telerik.com/teststudio/features/elements-explorer/find-element#data-driven

but it doesn't seem to provide a solution to append the data driven

 

3 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 31 Jul 2020, 02:12 PM

Hi David,

Thank you for the thorough description of what you have explored so far. 

You have correctly identified that the find logic of the elements can be data driven and this is the most suitable approach you can go for to cover the described scenario. Though, I have to admit that there is no option to append the data driven value to a static part of the id attribute.

So, what's left is to adjust the data source with the whole string of the id instead of only having its dynamic part. That said, you can have the data source column filled with row01, row02, ... row10, etc. 

I hope this information will be of further use. Of course, if you have any further questions, please, do not hesitate to get back and continue the discussion.

Regards,
Elena
Progress Telerik

0
David
Top achievements
Rank 1
answered on 10 Aug 2020, 05:49 PM
Thanks Elana, This helps !
0
Elena
Telerik team
answered on 11 Aug 2020, 08:32 AM

Hi David,

I am pleased to know that the suggested approach worked for you. Hopefully, there will be no further difficulties in the automation project you work on. Though, if any questions arise, do not hesitate to contact us again. 

Regards,
Elena
Progress Telerik

Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Elena
Telerik team
David
Top achievements
Rank 1
Share this question
or