How to click the 2nd Element in xpath search in the Object Repository

You only show the HTML to the div tags, so if there is much below them, you will have to flush this out.
How about trying:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import org.openqa.selenium.By as By
import org.openqa.selenium.Keys as Keys
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement

import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

List<WebElement> oddsList = DriverFactory.getWebDriver().findElements(By.xpath('//div[@class="odds_btn"]'))
WebUI.comment("Found a list of ${oddsList.size().toString()}")
for (cnt = 0; cnt < oddsList.size(); cnt++) {
    oddsList.get(cnt).click() //Select each Odds
    WebUI.delay(2)
}
3 Likes