Radio buttan selaction

i have problam in checking radio button, Let s say i have radio button name male,femal,tranc no i want to select male and the value it take from excel,then another ntime i want to select female from excel , then another time i want to selact trance from excel every time diffrent is thair anty way to do this.

How about putting the state of the radio button within an if statement and use the Excel data as the “condition” whether to check the radio button or not? You can use any indicator you want in your Excel and replace the word, ON, which I used.

Maybe like:
if (excelData.getValue(1,radioMale) == "ON") {
    WebUI.check(findTestObject('radioMale'))
    WebUI.verifyElementChecked(findTestObject('radioMale'), 10)
    WebUI.verifyElementNotChecked(findTestObject('radioFemale'), 10)
    WebUI.verifyElementNotChecked(findTestObject('radioTrance'), 10)
}
if (excelData.getValue(1,radioFemale) == "ON") {
    WebUI.check(findTestObject('radioFemale'))
    WebUI.verifyElementNotChecked(findTestObject('radioMale'), 10)
    WebUI.verifyElementChecked(findTestObject('radioFemale'), 10)
    WebUI.verifyElementNotChecked(findTestObject('radioTrance'), 10)
}
if (excelData.getValue(1,radioTrance) == "ON") {
    WebUI.check(findTestObject('radioTrance'))
    WebUI.verifyElementNotChecked(findTestObject('radioMale'), 10)
    WebUI.verifyElementNotChecked(findTestObject('radioFemale'), 10)
    WebUI.verifyElementChecked(findTestObject('radioTrance'), 10)
}

If you want to test the radio buttons one after the other, then you should put a delay inline of the if statement.

1 Like

can you provide a video or video link to do that i an stucking hear since 1 month , because it was easy to handal it by video.

There are several videos in the following link that might help.

Read and write data from excel in katalon studio – Codebun

1 Like

buddy. i know data drivan testing very well i just want ti ask you how to use this it stetment for radio butten any video for this

i kow very well about how to make data fill and test sweet in katalon i just want to ak you how to do this with radio butten plz help me bro plz

Sorry. I’m not sure of the concern. I have given you an if statement concept, so now you have to make some reference in your data file to indicate you want the radio button to be on (or off). Then you read your data file and use the text of your data file as a switch–the if statement needs a condition that compares to be true or false. So, maybe you have the word, ON, in your data file for the “radioMale” button, then you code something like below:

if (excelData.getValue(1,radioMale) == "ON") 

(Groovy - If/Else Statement)

There are many ways you could be getting your data values, so whatever you need to get the text or number for your “radioMale” button, do that in place of what I used (it was only an example):

excelData.getValue(1,radioMale)

Perhaps you are only using the Manual tab. If that be the case, then you will have to use: Decision Making Statement. I don’t use the Manual tab, so that will be on you to get the statements as you want them.

1 Like

Thanks I found my solution :+1:
I have 2 more questions for you
I want to select date from :date: date picker from Excel. Let’s say Frist time we have to pic 02/11/2022 then second time we have to pic 09/12/1991 and so on.
Note… we can not put date directly we have to pic it from date picker.

  1. Is thair any way to extract data from image and put it in Excel or katalon studio or extract valuable data and put it to web form

And last but not least thanks again

I assisted another OP on their date picker. Unfortunately, there are a lot of different date pickers, so this may just be an example for how to separate the various parts of the date picker and then pick and parse your way through it.
The easiest obviously is to use setText(), but if you can’t then you can try something like I did back then.