Is there a way to find or validate that a hyperlink exists within a page?

Hi UiPath community,

I would like to know if it’s possible to find or validate that a hyperlink exists within a page.

The case is that I have to use the search feature in the page that takes me to the results page where I have to validate if a specific hyperlink exists from all the results.

  • Search for “ABC”
  • The results page will display many results containing “ABC”
  • Find/validate that the result with the specific hyperlink for “ABC” exists.

Thanks in advance,
Ruben B

Use For Each UI Element and an If inside it to check the URL for the text you’re looking for.

@jpereyra

You can use find chuldren activity by indicating whole page and inside that use filter as <webctrl tag='A' />

If the result count is >0 then you have atleast 1 and you have those uieements with you as well

Cheers

Hi @Anil_G ,

Thanks for the information.

I’m pretty new using UiPath. Is there a way to get the values of all the results or assign them to an array?

Thanks,
Ruben B

Assuming the results are in a table, you’d use Table Extraction for that.

You can also use Find Children to, for example, get all the “A” tags on a page.

As I already mentioned, you can simply loop through all the links using For Each UI Element and check the href property of each one.

@jpereyra

What you get as output is an array of uielements

Cheers

Should also add - is they hyperlink typed out as the actual link? Or does it have some other display text?

If the links have some kind of display text like “click here”, but you want to check the actual hyperlink, you might have to use Get Attribute to get the “href” attribute, and check if that matches your required hyperlink.

Thanks all for your suggestions!

I was able to configure the “Find Children” activity to get all the “A” tags on the page as you mentioned, then I used a “For Each” activity and “Get Attribute” activity inside it to get the href values.

Is it possible to get the index of the results so I can identify the position of a specific result in the page?

Thanks in advance,
Ruben B