Forum Discussion

ḥari's avatar
ḥari
Frequent Contributor
2 years ago

How to verify hyperlinks

Hi

 

Here I have attached image there "Test complete samples" are href links. How can I verify while mouse Hover to that element it shows underline and color change??

 

Any inbuilt methods available in TC!!!

 

 

 

Thanks team!

2 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Default style links are rendered by the browser. However, if the website is using CSS for styling links then you should be able to get the attributes, see Getting CSS Attributes.

     

    You can use getAttribute('href') method to return the URL.

    • ḥari's avatar
      ḥari
      Frequent Contributor

      To get the font color can I use like this

       

      var color = page.FindElement("xpath");

        Log.Message(color.style.fontcolor);