Method call to verify links reports good links as inaccessible

Hello, I have a script that uses the “verifyAllLinkOnCurrentPageAccessible” function. All the links used to pass until recently (before upgrading to Katalon 7.0 I believe). Was there a change to this method?

Now I’m getting a lot of failures, mainly for links to .css, .ico, aspx, etc.

However I can paste all those links in my browser window, they open fine.

I’m using:
Katalon 7.0.10
browser = Chrome 78.0.3904.108

I think you’ll need to show us some of the HTML, code and errors.

I tried this:

    wam 'Nav to Katalon forum page'
    wam 'Check ALL links are accessible'
    WebUI.verifyAllLinksOnCurrentPageAccessible(false, null, FailureHandling.CONTINUE_ON_FAILURE)
    wam 'Navigate to Katalon home page using makeTO and the "K" link on the forum page'
    TestObject to = makeTO("section#main a[href='/']")
    String sURL = WebUI.getUrl()
    if(sURL != "") {
      KeywordUtil.markFailedAndStop("Something went wrong")

wam is just my way of writing comments to the output:


The code is pretty basic:


autoit_prj = 'C:\\Apps\\Git\\authenticate.exe'


//Validate all links on this page
WebUI.verifyAllLinksOnCurrentPageAccessible(false, null)


These are the errors I’m getting (took out all 70, just leaving the first few. domain replaced with XYZ):

2019-11-19 11:54:17.622 WARN c.k.k.core.keyword.internal.KeywordMain - Found 70 inaccessible links [,, at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.builtin.VerifyLinksAccessibleKeyword$_verifyLinksAccessible_closure1.doCall(VerifyLinksAccessibleKeyword.groovy:52)
at com.kms.katalon.core.webui.keyword.builtin.VerifyLinksAccessibleKeyword$
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
at com.kms.katalon.core.webui.keyword.builtin.VerifyLinksAccessibleKeyword.verifyLinksAccessible(VerifyLinksAccessibleKeyword.groovy:37)
at com.kms.katalon.core.webui.keyword.builtin.VerifyLinksAccessibleKeyword.execute(VerifyLinksAccessibleKeyword.groovy:32)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyLinksAccessible(WebUiBuiltInKeywords.groovy:3709)
at com.kms.katalon.core.webui.keyword.builtin.VerifyAllLinksOnCurrentPageAccessibleKeyword$_verifyAllLinksOnCurrentPageAccessible_closure1.doCall(VerifyAllLinksOnCurrentPageAccessibleKeyword.groovy:40)
at com.kms.katalon.core.webui.keyword.builtin.VerifyAllLinksOnCurrentPageAccessibleKeyword$
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
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$ Source)
at Verify all links on main all links on main page:42)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.TestCaseExecutor.runScript(
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
at com.kms.katalon.core.main.TestCaseExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)

Here’s some of the html:

I’m starting to wonder about the URLs in the links on your page especially since all 70 fail.

Can you confirm my code? Create a new test, drop my code in, (rename wam to WebUI.comment)

With a couple small tweaks to the code:

The links all passed:

There was an issue clicking on the “to” object, but maybe that’s cause of my updates (replaced makeTo with new TestObject)

In my initial test I do get a lot of links that passed.

Sorry, I forgot about makeTO - get it here if you think it useful.

So, the outcome is this:

  1. verifyAllLinksOnCurrentPageAccessible() is working in 7.0.10.
  2. Your page returns all links as inaccessible.

Try using verifyLinksAccessible() and pass it one or two links from your page. Be absolutely certain you are passing fully qualified URLs. Let me know how that goes.

Using verifyLinksAccessible() also fails.
See attached for full console output.

errors.txt (11.0 KB)

@ThanhTo @devalex88 Is there a way to expose the results of the server call when verifyLinksAccessible() is doing its thing? Would be good to know/show the responses.

@Galina_Moore The links you used are using the http: protocol. Is this correct?

Yes, that’s correct.

Sit tight and wait for the devs to take a look.

Top Secret !!!

Katalon management keep the devs in cages out the back but they’ll be woken in about 3 or 4 hours - and to earn their breakfast, they have to respond to shout outs like mine above :wink:

If you add only the waitForPageLoad then does it pass ? Looks like we need to pin down what changes make the test case pass. Then after that try to comment out waitForPageLoad and add FailureHandling to verifyAllLinksOnCurrentPageAccessible.

@Russ_Thomas, Gonna talk to the team, but I think Chrome Dev Tools allows us to monitor the network requests

Additionally, this is my quick test on 7.0.10:


WebUI.verifyAllLinksOnCurrentPageAccessible(false, [])


The test passes successfully.

1 Like

I checked in Firefox but the traffic seems to be completely inside Katalon (WebDriver?). IOW, I saw no evidence the browser is used to make the requests.

Yep, you got 100% from this page - same as me.

OK, waitForPageToLoad() did not help. Same result. Just to be clear, a lot of the links on the page do pass.

@ThanhTo, when you say add FailureHandling(), you mean doing this:
WebUI.verifyAllLinksOnCurrentPageAccessible(false, null, FailureHandling.STOP_ON_FAILURE)

Just tried that call and got the same result as before.

Will try the network monitoring next. Stay tuned.

Using the network monitoring in DevTools, I can individually open the links that the script says are inaccessible. Example screenshots below.
I tried having DevTools open while the script is running but it’s not showing any network traffic. Also when I open the URL manually (outside of Katalon) and view the network traffic, there are no errors. All requests show a 200 response.

That is weird. May I ask are you using any kind of proxy ?

Like I sad @ThanhTo, I got similar results in Firefox - no proxy here. I think Katalon/WebDriver is handling the request itself - in essence, it is the proxy.

(One day I’ll learn to use wireshark :roll_eyes: )


Katalon would create a new Request object and ping to the link to see if there is a response, it is kind of separate from the web driver, so that’s why I think proxy may be an issue.

Right. The question is, what route does that ping use. I see no evidence it passes through the browser. I suspect it’s endpoint (acutally, “beginpoint”) is in Katalon. IOW, looking for that traffic in the browser would never work.

1 Like

@Russ_Thomas Fiddler can capture the traffic too, and is simplest to use compared with wireshark

1 Like