# How to get and verify links within a certain object

**URL:** <https://forum.katalon.com/t/how-to-get-and-verify-links-within-a-certain-object/6625>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [October 2, 2017, 9:54am UTC](https://forum.katalon.com/t/how-to-get-and-verify-links-within-a-certain-object/6625 "2017-10-02T09:54:51Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![shilpi1](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shilpi1](https://forum.katalon.com/u/shilpi1)\
**Post date:** [March 25, 2020, 10:44am UTC](https://forum.katalon.com/t/how-to-get-and-verify-links-within-a-certain-object/6625/21 "2020-03-25T10:44:07Z")

</div>

Got it, now updated with  
.//\*[@class=“headerlinksdiv”]/span/map/p/table/tbody/tr/td/table/tbody/tr/td/a  
**but start getting error:**  
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object ‘[https://dev1studentconnect.acu.edu.au/bandev1/acu.wzkmoff.p\_start\_page](https://dev1studentconnect.acu.edu.au/bandev1/acu.wzkmoff.p_start_page)’ with class ‘java.lang.String’ to class ‘java.util.List’

---

<div class="post-metadata">

**Author:** ![shilpi1](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@shilpi1](https://forum.katalon.com/u/shilpi1)\
**Post date:** [March 25, 2020, 10:55am UTC](https://forum.katalon.com/t/how-to-get-and-verify-links-within-a-certain-object/6625/22 "2020-03-25T10:55:52Z")

</div>

fixed it by this, that you have suggested in other queries-  
List allURLs = WebUI.getAllLinksOnCurrentPage(true, )  
println ('Total links on page: ’ +allURLs.size())

```
	WebElement element = WebUiCommonHelper.findWebElement(findTestObject('Object Repository/Progression/Management/StudentPLinkVerification/MainMenuLinks'),20)
	List URLs = Arrays.asList(element.getAttribute('href'))
	print URLs

```

now the issue , in output I am getting only first link, not other . I have many more links on page

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/d/db30a834be4a57200f3cbebdd97db674ba407cbf.png)

---

<div class="post-metadata">

**Author:** ![parker.emmily](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/parker.emmily/32/16104_2.png) [@parker.emmily](https://forum.katalon.com/u/parker.emmily)\
**Post date:** [January 5, 2022, 3:23am UTC](https://forum.katalon.com/t/how-to-get-and-verify-links-within-a-certain-object/6625/23 "2022-01-05T03:23:22Z")

</div>

Hello , thanks for information)

[Previous page](https://forum.katalon.com/t/how-to-get-and-verify-links-within-a-certain-object/6625.md?page=1)
