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