cancel
Showing results for 
Search instead for 
Did you mean: 

How to confirm the hyperlink URL without clicking the hyperlink?

SOLVED
Highlighted
New Contributor

How to confirm the hyperlink URL without clicking the hyperlink?

Hi,
Does anyone know how to confirm the URL 'behind' a hyperlink is correct without having to click the hyperlink?

 

For example, I have a hyperlink on the screen with the label 'Home' and the 'a href' value of the hyperlink is "https://abc.com", for example. i.e./ <a href="https://abc.com/">Home</a>

 

When the mouse pointer hovers over the hyperlink, the URL is displayed above the status bar as "https://abc.com", as expected.

 

When executing the test manually, I can see that the URL is correct, but when I use the 'Record & Replay' functionality to capture my steps (hover functionality), there does not appear to be a way to confirm that the expected URL is found/displayed.

 

If a developer accidentally modifies the URL, my 'Record & Replay' test case would still pass, even though the wrong URL was linked to the 'Home' hyperlink based on the AI decided XPath. i.e./ //html[1]/body[1]/footer[1]/div[1]/div[1]/div[1]/ul[1]/li[1]/a[1]

 

Thank you in advance for any assistance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: How to confirm the hyperlink URL without clicking the hyperlink?

Answer provided by Nick from CrossBrowserTesting:

 

You can verify an HREF by using 'Add Expect' and selecting 'Element'. Once you have clicked on the element that contains the HREF, you will see a dialogue open. Change the Expect to 'Attribute' and the Name to 'HREF'.

 

Usually, the Value will populate with a portion of the URL from the HREF, so I would recommend to paste in the entire link or adjust the 'To' field to Contains. 

View solution in original post

1 REPLY 1
Highlighted
New Contributor

Re: How to confirm the hyperlink URL without clicking the hyperlink?

Answer provided by Nick from CrossBrowserTesting:

 

You can verify an HREF by using 'Add Expect' and selecting 'Element'. Once you have clicked on the element that contains the HREF, you will see a dialogue open. Change the Expect to 'Attribute' and the Name to 'HREF'.

 

Usually, the Value will populate with a portion of the URL from the HREF, so I would recommend to paste in the entire link or adjust the 'To' field to Contains. 

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements