HTML/css selector non-id

I am working with a website that is dynamically generated. I have a table of entities, where every row links to a detail page. On the detail page there are boxes with data, for instance a visual checkbox. I want to check if the checkbox is true or false.

The page has multiple checkboxes, depending on the status of the entity. These checkboxes are placed in a div with an id like “field_258742288_israted”. The number is specific for the entity, meaning I can’t check for the id. Also, the exact css selector doesn’t work, because sometimes the checkbox I need is in the 3rd div, sometimes it’s in the 5th.

The element looks something like:

-div class=“readonly boxItemField” data-name=“israted” data-time=“c” id=“boxItemField_258742288_israted”>
-input checked=“checked” class=“dc-type-togglebutton selected” data-name=“israted” data-time=“c” data-type=“togglebutton” disabled=“disabled” id=“field_258742288_israted” name=“israted” type=“checkbox”>
-label class=“label-checkbox toggle-button-tooltip” for=“field_258742288_israted”>/label>
-span class=“icon icon24 icon-star toggle-button-tooltip”>/span>/div>

With '-'instead of ‘<’ because the forum does formatting with ‘<’.

I would like to use the other attributes like data-name instead of id, but when I try that in my selector it can’t validate the item.

You could try using the FindChildren activity targeting the boxes where the checkboxes are. You can apply a filter to this, e.g. data-name=“israted”, so it returns only those that have that attribute. Then you will know the status of the checkbox I assume.