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

Test Automation

1 Answer 72 Views
Interesting resources
This is a migrated thread and some comments may be shown as answers.
Sipho
Top achievements
Rank 1
Sipho asked on 10 Nov 2020, 12:47 PM

Good day, will like to request some help here. 

 

How do i GetText from an element 

<a href="/orders/Details/22344">ERP30114</a>

 

this is a link so i want to use the linkText to find click the link

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 10 Nov 2020, 02:36 PM

Hi Sipho,

Thank you for contacting us. 

As far as I understand you are currently evaluating Test Studio for test automation and you would like to use the text of a href control on the page to locate that particular link by its text.

If I have correctly understood your needs, there are few notes to share, which will help you understand how Test Studio manages the elements in the tests. During a recording session Test Studio detects the actions performed against the page and records the corresponding steps. Each of the recorded steps is related to an element in the Elements Explorer

Each element in Test Studio is using a find expression to be located on the target page. It is generated automatically based on the find logic order set in the project settings (you can fine tune it according to the application under test specifics - e.g. if all id attributes are dynamic, it will be best to not rely on the id). 

The already generated find expression can be easily modified - you are allowed to use all of the html element's attributes. If you attempt to do this during an active recording session, all available attributes for an element will be listed - that way you can pick any of them including the text of the href

In addition to all these options you can also data drive the find expression of an element. That way you can reuse the same element, but locating different href based on its text for each iteration in the test. 

I hope that this information will be helpful for you to sort out what fits best for your needs. Do not hesitate to get back to me in case of any further questions. 

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Interesting resources
Asked by
Sipho
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or