How to select and click an element without the ID



I’m testing my page with a list of member (like 200 divided in several pages).
I would like to click every pages: the problem is that I don’t want to create 200 objects…how can I just tell Katalon to click the first element, than the second one, and so on?

Thank you,


If there’s a button that says “Next Member” just write a test that clicks that button over and over.

Oh, there’s no such button?

Tell you what, to save me (and the rest of us) from guessing, and to help you help us, read the following link and post back with any relevant information (and PLEASE read it… it contains all the info you need to help us and you!)


You can use dynamic objects. So in a loop that ranges from 1 to 200 you can write a click on that object where the range index is passed as a parameter.
object’s xpath must be given in the attributes section
div/div[1]-- is the first object
div/div[{RowNumber}] – dynamic object‘Object’,[(‘RowNumber’) : index]))


Ok, you are right.

No, unfortunately there is not a “next member” button.

The link is:

The project, right now is simple because the first step for me is achieving clicking every link.

So, I create the action of click (Object repository) and I put the css (“Css selection”) that I found with the plugin “ChroPath”: section.section.content:nth-child(2) div.content-result-def:nth-child(4) div.content-wrapper div.content-container.container-16 div.companies-listings.block div.listing-body div.listing-title > a:nth-child(1)

And I saw that the first link has “…nth-child(1)…”, and the second one has “…nth-child(2)…”, but it’s not working.

Obviously I can’t use the “relXPath”, because gives me the ID of the link (that’s always changing).

The error is:

tack trace: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/3D/Page_You searched for 3D Printing/Page_You searched for 3D Printing/a_Read More’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (228, 278). Other element would receive the click:

(Session info: chrome=71.0.3578.98)
(Driver info: chromedriver=2.43.600210 (68dcf5eebde37173d4027fa8635e332711d2874a),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds

Thank you


Thank you.

So in the attributes section, what I put in “name”, “Condition” and “Value”?



This error is usually caused by something else being in the way. Try waiting for your element to be visible before accessing it.


Just inspect the object in the chrome developer tools. Copy xpath of the object one by one and see where the index is getting changed and frame the xpath like what I wrote in the above answer. Then click on add attribute in object properties and copy it in the xpath equals the copied attribute path.
Please share the xpaths of 2 or 3 objects so that I can give you a better solution.



May be you can try this.



I was waiting, but nothing. The links are visible.


But in this script they control if the link are accessible. How can I, for example, open every link?


I already did it. And I find that the index that is getting changed is:


So I put it:


But it doesn’t work.

If I record the click of the link, Katalon create this action:


Thank you


You have to set the xpath in the attributes.

This looks like the below

In the script use the object like this‘Object’,[(‘RowNumber’) : indexinthefoorloop]))


doesn’t work…it doesn’t click. I tried with a number instead of “$(LinkNumber)” but nothing. Did you try your script with web page?


I will try on your web page and let you know. The syntax is ${LinkNumber} :smile:
By the way is you page 3D printing business directory?


The xpath in the webpage is not constant. So we cannot substitute an index with a variable to access all the links. This generally works with the table data where everything is constant except the row number or some layout that is similar to this. So I have posted a question here.

If we get a solution on this we can achieve your project requirement. When is the deadline?



Hi Kavya

thank you for your engagement!
Ok, so I have to find a new solution…I don’t have any deadline.

Thank you!


Hi Stefano
We’ll find a solution soon.



With all the engagement on this topic, I figured it had already been worked out :sweat_smile: Lets take this step by step, in detail, and I will give an example solution at the end for what I think you are trying to accomplish:

1.) Locating the links

On the page you linked, I’m assuming that you want to click on the Read More “button” (really, a link) for each search result:


Note: You could also click the link associated with the “listing title” to achieve the same goal:


So, lets create a Test Object with an XPath that will identify all links of this type. I will write an Xpath for the Read More button, but you could easily do this for the other link:

2.) Working with the pagination

You mentioned that you want to click ALL links, and that the set of all links is divided into pages (i.e. they are “paginated”):


This means that you will need another Test Object to manipulate the pagination widget as well. This can be handled in a couple of ways, but I’ll just follow the same idea we’re using for the links themselves and grab all page links that are available:

3.) Test code

Since you haven’t specified what you’re actually trying to do beyond “click every link”, I will write the test code based on the assumption that that’s literally all you are trying to do, and you can fill in the rest:

import org.openqa.selenium.WebElement

import com.kms.katalon.core.testobject.ObjectRepository
import com.kms.katalon.core.webui.common.WebUiCommonHelper
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI


// Get a list of all pages in the pagination widget:
List<WebElement> pageLinks = WebUiCommonHelper.findWebElements(ObjectRepository.findTestObject("pageLink"), 30);

// Loop through each page in the pagination:
for(WebElement pageLink : pageLinks) {
	// Click the page link:;
	// Get a list of links for the current page:
	List<WebElement> searchResultLinks = WebUiCommonHelper.findWebElements(ObjectRepository.findTestObject("searchResultLink"), 30);
	// Loop through each result link in the page:
	for(WebElement searchResultLink : searchResultLinks) {
		// Click the result link:;
		// Do some validation? You haven't further specified what you're trying to do with each link...
		// Return to the search results page:

4.) Final notes

The idea here is to get a List of WebElements that you can do whatever you want with. This is much easier (in my opinion) than trying to get individual WebElements using some dynamic XPath, as has been suggested. With this approach, you simply get a list of all target elements, then you can either loop through them, as I’ve shown above, or you can select individual elements from the list using an index:

List<WebElement> searchResultLinks = WebUiCommonHelper.findWebElements(ObjectRepository.findTestObject("searchResultLink"), 30);
WebElement firstLink = searchResultLinks.get(0);
WebElement secondLink = searchResultLinks.get(1);

Hopefully this helps! :metal:


Thank you Brandon for your code!!

I add the two variables:

that’s true?

Unfortunately, I got this error:
" unknown error: Element is not clickable at point (284, 16). Other element would receive the click:


The error is at Statement -

thank you!


This solution is good. I was just looking for a solution where creation of one object is enough as per the requirement of charliar.

There was a solution given for this. We have to try it out.
Anyways thanks for your solution. It helps.