Unble to identify value is checked or not

Hello,

i need to valdiate is value is checked or not if yes then no need to do action and if uncehck then need to check.
but when i am cehcking with selectors it is taking css selector

let me know how can i do this

Hi @Mathkar_kunal

Use Get Attribute activity.

Set Attribute = “checked” or “aria-checked” (based on selector).
Store in string variable.

Use If:
If value = “true” then do nothing
Else use Click activity to check the box

Example:
Get Attribute → “checked” → result
If result = “true” → skip
Else → Click checkbox

Can you check the element in UI Explorer when it is both checked and unchecked?

Compare the attributes in the top-center tree and right-side properties panel. Usually there will be an attribute such as checked, selected, aastate, class, or another property whose value changes between the two states.

You can then use Get Attribute on that property and build your logic based on the returned value.

checking with get attribute
but issue is only css selector is there

i need to seelct only for Estimation cehckbox

@Mathkar_kunal

Follow the below steps,

  • Use Get attribute activity
  • Indicate the element, at the time indicate go to UiExplorere there indicate the element.
  • set the attribute value in Get attribute activity and create the output variable for that actiivty
  • then use If activity, in else section add check/uncheck activity to check the checkbox.

Refer the below video for more info

Happy Automation

@Mathkar_kunal Yes, you can uncheck the css-selector from the Selector Editor/UI Explorer and try to select only stable attributes.

In UI Explorer, check if any stable attributes are available, such as: aaname
text
name
role
id
parentid
aria-role

Avoid using:

css-selector
idx

Hey @Mathkar_kunal

Use Check/Uncheck activity modern and enable Verify execution. The activity automatically checks the box only if it is not already checked.

Else you can try Check app state or element exists activity for blue tick icon only as your css selector shows the check box is in div tag so no attribute will be present. Use Check app state or element exists activity for blue tick icon only as seen in image that blue tick icon appears after checking the box.

cheers

Hi @Mathkar_kunal,

If the requirement is to check the value, then after searching, you can use the Check/Uncheck activity. It will not clear the checkbox.

Thanks