Choosing values for Checkbox and Radio button from Excel

I have multiple check boxes and radio buttons in UI (Website).

I want to select some checkbox/radio button values, whose values are available in excel. My excel data is as below:

Column A | Column B | Column C | Column D
Checkbox1 Checkbox2 Radio Button3 Radio Button4

Recorded generated Katalon code:‘Page_Form/input_ServiceLists’))

Can someone help on how to assign Checkbox and Radio button to get the value from excel?

You could assign either a word or number in Excel that indicates a Checkbox (or Radio button) is ON (or OFF). Then compare that word or number in an if statement and adjust the element as needed.

if (excelWord == “set”) {‘Page_Form/input_ServiceLists’))


if (excelWord == “2”) {‘Page_Form/input_ServiceLists’))

1 Like

Thanks for your contribution.
However, I’m not comparing the values. I just want to automate the element (checkbox and radio button) by taking the value (id) from Excel.

Nevertheless, I check your method and I got error message.

Although, I found this online -

Use IF ELSE condition for check/Uncheck the checkbox same as for radio button also. In Excel store the Checkbox/radio button column value as 1/0 if 1- check 0-uncheck

       For Radio/Checkbox
       write a code to click
       For Checkbox 
       write a code to uncheck

Thanks for your help.

Issue resolved with the solution code below. The code is working as expected -

if (findTestData(‘Data Files/ExcelData’).getValue(Column B, 1) == ‘1’) {‘Page_Form/input_ServiceLists’)) }
else {
(findTestData(‘Data Files/ExcelData’).getValue(Column B, 1) == ‘0’).call({‘Page_Form/input_ServiceLists’)) }

'Wait 2s'


if (findTestData(‘Data Files’).getValue(1, 1) == ‘1’){‘Page_Form/input_ServiceLists’))}
else (findTestData(‘Data Files/ExcelData’).getValue(1, 1) == ‘0’).call({‘Page_Form/input_ServiceLists’))})
‘Wait 2s’
if (findTestData(‘Data Files’).getValue(2, 1) == ‘1’){‘Page_Form/input_Services’))
} else
(findTestData(‘Data Files’).getValue(2, 1) == ‘0’).call({‘Page_Form/input_Services’))})

@helpdesk I’m having issue with zero ‘0’ if I set the value in Excel to be ‘1’ the checkbox is ticked but if I set value to be zero ‘0’ the automating stop. What am I doing wrong?

If the program to continue automating.

You could check if you enter a zero in Excel, does the zero “disappear”. If it does, then check out the below:,have%20zero%20value%20check%20box.

Another possibility is that your ifelse is incorrectly phrased. The assumption is that if the value is not 1, then it must be 0, so you would not need to make the comparison on your “else” clause:

findTestData(‘Data Files’).getValue(2, 1) == ‘0’)

When I review your ifelse statement, it looks like you do the same regardless if the value is zero or one.

There is also the option of:
if (condition == 1) {
… statements…
} else if (condition == 0) {
… statements…
} else {
… statements…

There is no problem with zero in Excel.

The only problem is if I don’t need to click on particular checkbox then the test should continue running.but the test terminate.

Then remove, or comment out, the else clause part of your statements and try again. Try to run your TC like below:


if (findTestData(‘Data Files’).getValue(1, 1) == ‘1’) {‘Page_Form/input_ServiceLists’))

‘Wait 2s’
if (findTestData(‘Data Files’).getValue(2, 1) == ‘1’) {‘Page_Form/input_Services’))

(Your else clause is incorrectly phrased. You have an ifelse if clause and you are missing the second if part. See an excellent sample at the below link. However, I don’t think you need the else clause in this instance.)

In your else code, you are trying to attach a method to an if condition rather than an object and that won’t work.

Below is the actually code I have.

Below is the Excel

If I change the value from 1 to 0. The automation will stop.

Comment out your else clause. Highlight the two lines of your else clause with your mouse and hit CTRL + / (forward slash) at the same time.

The automation stops because the else clause is not a properly formed statement. Review your console log to review the error message.

Indenting the statement did not make any different, have a look at it below

The issue is if I change the value in Excel from 1 to 0. Then the automation will stop and I don’t want it to do so.

Delete your else clause.

Your else clause is an error. Review your console log to review the error message.

1 Like

Could also do the below:

if (findTestData(‘Data Files/ExcelData’).getValue(1,1) == ‘1’) {
} else {

if (findTestData(‘Data Files/ExcelData’).getValue(2,1) == ‘1’) {
} else {

1 Like