Selecting mat-radio-button in robotic framework

I want to select a radio button which is with mat-radio-button.
I am able to click this with
click Element xpath://*[@id=“mat-radio-3”]
But I am passing values from csv file so How can I select this radio button.
Most of the time I am working with CSS like mat-option/mat-radio-button if any document there for this could you please share, it will be helpful.

Inspect for the radio button is:

Thanks in advance.

Hi Lavanya,

The way I would normally approach something like this is to use the label for the radio buttons, in this case “Any manual screening performed outside…”

  • best case that text is in a <label> tag which has a for attribute that you can use to identify the radio group
  • next best case the label and the radio buttons are all grouped together in a div or other tag so you can use a relative xpath to identify the radio buttons
  • worst case its a flat structure and you’ll need to employ some other more messy technique, but hopefully they are consistent and you can use the same approach for all

Do an inspect element on the text and see if it gives you any hint’s as to the radio group name?


I am not able to figure it out how to select this YES/NO buttons and value is passing from CSV file.

What is the content of the CSV file?

CSV Values

So ${frontend} relates to the “Any manual screening performed outside the Processing system …” question? Is this a variable?

Maybe you can try this xPath:

//mat-label[contains(.,‘Any manual screening performed outside the Processing system using the Front end interface’]/following-sibling::mat-radio-button[@value=‘N’]

1 Like