[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)
}