Verify the href value of a link

I’m overthinking this I’m sure but I’m getting nowhere. All I’d like to do is verify (or assert) the link a button on my page is pointing at. Link looks like:


I just need to confirm the href value.

I can’t seem to find a way to do this other than using VerifyHTMLSource to confirm my link value is present; but this doesn’t ensure that the value I’d like to check is really associated with the download image. There has to be a better way. Help is appreciated.

I have noticed you are using Katalon Recorder rather than Katalon Studio. I do not know much about the Recorder, but I suppose in KatalonRecorder you would have very little capability to verify accessibility of external resources represented as URL.

Provided that you do not mind stepping forward to Katalon Studio, you would have chance to implement your custom keyword in Java/Groovy. Please have a look at my sample code as follows:

Here I developed a Custome Keyword verifyUrlAvailability(String url). Using this keyword, you can test your AUT whether tags and tags are really associated with external entities.

Try to use storeAttribute

Thanks everybody. I tried messing around with the Attribute related commands and had no luck; unfortunately there aren’t any good identifiers on this link which I believe those commands really need to work as intended. I don’t like my solution much but I’m just going with verifying the link is in the html source for now. I do plan to move on to working with the Studio tool in the near future, I know it has many capabilities the recorder does not offer but I’m trying to knock something out quickly. Again thanks for your feedback.

Steven Taylor
What exactly at you it has not turned out?
here is my test case:
store href attribute to variable {href}

see stored var on Variables panel

don’t pay attention to “echo” it just for debugging
compare stored value and our link (use command verifyEval)

in your case it can be

1 Like

Hey Noor, you are awesome; I’m not sure what I was doing wrong with my locator but I went back and tried again and was able to get it to work; this is a much nicer way of handling what I was trying to accomplish. Thanks for providing the examples above, it answered another question I was going to end up having once I was able to capture the link value (verifyEval, wasn’t familiar with that command either). :slight_smile:

1 Like