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

How to deal with hyperlink

3 Answers 56 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.
John
Top achievements
Rank 1
John asked on 22 Apr 2012, 09:51 AM
Hi All,

I want to click on hyperlink, hyperlink TextContent can be anything which I am specifying in my xml fie(data file).How to do this?

3 Answers, 1 is accepted

Sort by
0
Byron
Telerik team
answered on 23 Apr 2012, 05:52 PM
Hi John,

The best practice is to locate an element based on the element's unique ID. If your hyperlink has an ID, Test Studio will use this ID to locate it by default when you record a click on the link in your recording browser. In this way, you can avoid identifying the hyperlink by TextContent.

Please let us know if we can assist you further.

Regards,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
John
Top achievements
Rank 1
answered on 24 Apr 2012, 06:35 AM
Byron,

Thanx for your reply.
We dont have unique ID for those hyperlinks,I have to identify those links with TextContent/Text only.Whichever name specified in xml file I want to click on that hyperlink(its like data driven).Is it possible through normal recording or I will have to go for coded steps?If yes how?
0
Byron
Telerik team
answered on 24 Apr 2012, 05:26 PM
Hello John,

At this point, there is no tool in the Test Studio user interface to set up data driven find expressions. You can, however, use a coded step. You may already know how to add an XML document as a data source. Once you have done so, you can use code to find an HTML link based on the value of a variable in your XML document. The last code sample on the page accomplishes your goal, where "Col1" is the name of the variable in your XML document containing the TextContent you are searching for. Please let us know if we can help you further. 

All the best,
Byron
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
John
Top achievements
Rank 1
Answers by
Byron
Telerik team
John
Top achievements
Rank 1
Share this question
or