[WebUI] Verify All Links On Current Page Accessible


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/webui-verify-all-links-on-current-page-accessible.html

Its not clear from the documentation how to return/store/otherwise manipulate failed links.
Its a great little implementation but presently all the intelligence is opaque ie which links failed.
Please inform if thereā€™s a way to filter the failed links - preferably return hrefs/URL values.

1 Like

I want to ask what kind of ā€œlinksā€ does this function check. Does it check the external web links? Thanks!

I confirm the inaccessible link is listed in the logs (see bellow), but I agree with @ze2: this is too opaque to use.
I am getting feedback that a certain linkedin link is inaccessible, but actually it is. What is ā€œinaccessibleā€ anyway?

  • links to a page that does not exist?

  • the anchor is not clickable because of another element being on top of it? etc

I also want to point out an error that seems really embarasing:
image

Why does this Katalon function need an object named ā€œTemporary RESTful request objectā€?
Is it some leftover from the implementation, is this how much test Katalon gets before being shipped? :slight_smile: (I will continue to get involved more in the beta version testing process)
If this object is indeed needed, why isntā€™it mentioned in the documentation, and what itā€™s purpose is.

Thank you.
Cornel

I am testing this exact example ( verify if all links on ā€˜http://demoaut.katalon.comā€™ are accessible) but it doesnā€™t work for me. Any idea?

Thank you!

Unable to verify all links on the page ā€˜https://katalon-demo-cura.herokuapp.com/ā€™ are accessible (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to verify all links on the page ā€˜https://katalon-demo-cura.herokuapp.com/ā€™ are accessible at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64) at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26) at com.kms.katalon.core.webui.keyword.builtin.VerifyAllLinksOnCurrentPageAccessibleKeyword.verifyAllLinksOnCurrentPageAccessible(VerifyAllLinksOnCurrentPageAccessibleKeyword.groovy:48) at com.kms.katalon.core.webui.keyword.builtin.VerifyAllLinksOnCurrentPageAccessibleKeyword.execute(VerifyAllLinksOnCurrentPageAccessibleKeyword.groovy:32) at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60) at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyAllLinksOnCurrentPageAccessible(WebUiBuiltInKeywords.groovy:3754) at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$verifyAllLinksOnCurrentPageAccessible$0.call(Unknown Source) at AA - Verify links.run(AA - Verify links:24)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1583136602240.run(TempTestCase1583136602240.groovy:23)
Caused by: com.kms.katalon.core.exception.StepFailedException: Some of links on the current page are inaccessible at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64) at com.kms.katalon.core.webui.keyword.builtin.VerifyAllLinksOnCurrentPageAccessibleKeyword$_verifyAllLinksOnCurrentPageAccessible_closure1.doCall(VerifyAllLinksOnCurrentPageAccessibleKeyword.groovy:45) at com.kms.katalon.core.webui.keyword.builtin.VerifyAllLinksOnCurrentPageAccessibleKeyword$_verifyAllLinksOnCurrentPageAccessible_closure1.call(VerifyAllLinksOnCurrentPageAccessibleKeyword.groovy) at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20) ā€¦ 17 more
)

Anyone facing this issue? Any idea about what is going on with this basic example?
Thank you!

Hi, I get also that ā€œUnable to verify all links on the page ā€˜https://katalon-demo-cura.herokuapp.com/ā€™ are accessibleā€ error message. Any help?
Thank you

Try this, Iā€™m not sure that is correct, but it works:
@Then (ā€œI get all links on pageā€)
def I_get_all_links_on_page() {
List list = WebUI.getAllLinksOnCurrentPage(true, [])
println("Links on current page: " + list.size())
GlobalVariable.list_1 = list
}

@Then (ā€œI verify links accessibleā€)
def I_verify_links_accessible() {
WebUI.verifyAllLinksOnCurrentPageAccessible(true, GlobalVariable.list_1)
}

what if i want to get all a href links of a search results page of google ?

It looks similar to