How to deal with hyperlink

4 posts, 0 answers
  1. John
    John avatar
    13 posts
    Member since:
    Apr 2012

    Posted 22 Apr 2012 Link to this post

    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?
  2. Byron
    Admin
    Byron avatar
    184 posts

    Posted 23 Apr 2012 Link to this post

    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
  3. John
    John avatar
    13 posts
    Member since:
    Apr 2012

    Posted 24 Apr 2012 Link to this post

    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?
  4. Byron
    Admin
    Byron avatar
    184 posts

    Posted 24 Apr 2012 Link to this post

    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
Back to Top
  Cast Your Vote at DevPro Connections! Cast Your Vote at  Win IT Pro Connections!