If and else data driven from excel

I am trying to check the checkbox based on data from excel.
So my form has three radio button with only one can be selected(shown below).
I would like to select membership 1 if excel file has membership 1.
and 2 and 3.

So I have a variable as checkData and column name as checkData into Excel file.
I also have below if and else statement.

I am not seeing any error but at same time if statement does not select anything and I do not see anything into console.

Is it a correct approach to achieve this or any other process I can use?

Thanks

if(checkData == 1)
	{
		WebUI.check(findTestObject('Object Repository/input_Choose your plan_members (1)'))
	} else if(checkData == 2)
	{
		WebUI.check(findTestObject('Object Repository/input_Choose your plan_members (2)'))
	} else if(checkData ==3)
	{
		WebUI.check(findTestObject('Object Repository/input_Choose your plan_members (3)'))
	}

What value does the variable checkData have? Why not check it by inserting a println statement.

println "checkData=" + checkData
if (checkData == 1) {
...
}
....

It might have value of 0. — then nothing will happen as the code is designed.

1 Like

hi Kaz,
i think there is some issue with data binding from excel. here is original thead:

Thanks Kaz and Andrej for your help