You should be careful here, as two links that share the same text are not necessarily duplicates of each other (they may have other attributes that make them unique, most importantly the href attribute).
That being said, if you’re sure that a link’s text guarantees its uniqueness on your page, then the goal becomes “count the number of occurrences of the link with text ‘some text’, and assert that that number is either 0 or 1”.
There’s no built-in keyword that you will be able to call from the manual view to accomplish this. You will need to do some scripting, and it likely won’t be the last time you will need to do something like this, so why not start learning it now? Luckily, this one won’t be too bad. I’ll show you a brute-force way to do it, then a better way that I would do it if I were in your shoes:
Brute-force approach:
1.) Create a Test Object named “links” that grabs every link on the page:
2.) Go to the script view for your Test Case and enter the following code in the appropriate place (wherever you want to check for duplicates):
import org.openqa.selenium.WebElement
import com.kms.katalon.core.webui.common.WebUiCommonHelper
List<WebElement> links = WebUiCommonHelper.findWebElements(findTestObject("links"), 30);
int linkCount = 0;
for(WebElement link : links) {
if(link.getText().equals("some text")) {
linkCount++;
}
}
assert linkCount <= 1;
A better way:
1.) Create a Test Object named “links” that grabs all links that have a given text:
2.) Go to the script view for your Test Case and enter the following code in the appropriate place (wherever you want to check for duplicates):
import org.openqa.selenium.WebElement
import com.kms.katalon.core.webui.common.WebUiCommonHelper
List<WebElement> links = WebUiCommonHelper.findWebElements(findTestObject("links", [("text"): "some text"]), 30);
assert links.size() <= 1;
In both of these cases, you would replace “some text” with the link text that you are trying to validate.