User Login based off checkbox checked

I need help in writing code for the below scenario.
I should be able to click on login button for the user whose active checkbox is checked
If the first user is not active then I should be able to skip that user and login with the first active user in the list. Please help

We’ll need to see the HTML

@Russ_Thomas: Please find the html below.

Checkbox html for inactive user:

<img src="/img/checkbox_unchecked.gif" alt="Not Checked" width="21" height="16" class="checkImg" title="Not Checked">

Checkbox html for active user:

<img src="/img/checkbox_checked.gif" alt="Checked" width="21" height="16" class="checkImg" title="Checked">

Login button html for active user:
<a href="/servlet/;suorgadminid=0054O000009Ehmc&amp;retURL=%2F005%3Fid%3D00e30000000pm4l%26isUserEntityOverride%3D1%26SetupNode%3DEnhancedProfiles&amp;targetURL=%2Fhome%2Fhome.jsp" class="actionLink" title="Login - Record 2 - Bradshaw, Connie">Login</a>

Let me know if you need anything more.

You may be able to use something like:

import org.openqa.selenium.WebDriver
import org.openqa.selenium.By
import org.openqa.selenium.WebElement
import com.kms.katalon.core.webui.driver.DriverFactory

WebDriver driver = DriverFactory.getWebDriver();
List<WebElement> myList= driver.findElements(By.xpath('//td[@class="dataCell"]//img[@alt="Checked"]'));
int element_count = myList.size();
println("Found count of " + element_count.toString());
WebUI.comment("Found count of " + element_count.toString());

// not sure if you just click on line or something else

Worked for me. Thank you