cancel
Showing results for 
Search instead for 
Did you mean: 

how to read the value of checkbox(checked or unchecked)

SrinivasaraoVo3
Level 4
PFA for the screenshots. I want to read the checkbox value (checked or unchecked).Please help me
7 REPLIES 7

Denis__Dennehy
Level 15
The element in your screenshot is not a checkbox element it is just an image - the only way to identify an image is to use image recognition techniques (Surface Automation training).    It might be work using Application Navigator to see if there is an actual checkbox element there or if the image element is all that is available to you.  Also - look through your other unticked attributes to see if there is something that uniquely identifies the checked image as opposed to the unchecked image.

SrinivasaraoVo3
Level 4
Yeah it is image only and the difference between unchecked and checked images is Class Name ='x-grid-checkcolumn' for unchecked one and Class Name ='x-grid-checkcolumn x-grid-checkcolumn-checked' for checked one.how to the read the value whether it is checked or unchecked and how to set the value to checked in this case.please help me

Denis__Dennehy
Level 15
If it is an image rather than a checkbox element you will probably need to send a click event to it.  Use a navigate stage - click the image.  To be safe you can use image recognition to see if the image is checked or not before you send the click event (hopefully you will have done the surface automation training so you will know how to do that correctly)

SrinivasaraoVo3
Level 4
I cannot use Surface Automation as i have to table of records like this to scan through.I tried with html mode spying and i am using dynamic path to scan the table .I am able to get the values of all columns except the checkbox column(whether it is checked or not).And I need to click on the checkbox and submit to complete the operation.I tried with Navigate stage to click center or double click center but not able to click.I tried with Focus and Click Center but no use.Is there any way of changing the class name for the image using BP.

DaraghMonaghan
Level 3
Try a Read stage using the Get HTML Attribute function and specify the Class Name attribute as the variable. You have said above that there is a difference in Class Name between the checked and unchecked elements, so this should give you a value that indicates whether it has been checked. Stick a decision stage in after this and you can take necessary action. I'm not sure why you can't click the element however, perhaps try specifying its coordinates instead of using a centre click, or try different spying methods - for example AA rather than HTML.

Denis__Dennehy
Level 15
You can use Surface Automation mode - you just need to be clever in how you calculate the coordinates to look in - you can base that upon the location of a different element that you can uniquly identify (such as text on the same row).    Maybe reach out to any contacts you have with more Surface Automation experience if you are unsure. The get html element option mentioned above is another good thing to try.

SrinivasaraoVo3
Level 4
Can we use AA spying mode for the checkbox in the table with xpath as i need to scan through the table using dynamic path to set the checkbox checked.I checked that there is no path attribute in AA mode for the element .