<buttons:SfRadioButton x:Name="FalseRadioButton" AutomationId="FalseRadioButton" />
</buttons:SfRadioGroup>
The following code allows me to determine the value when the UI test is executed on Android:
var isChecked = app.Query(x => x.All().Marked(uniqueId).Descendant().Marked("FalseRadioButton").Invoke("isChecked")).First();
Note: the "uniqueId" is the AutomationId of the custom control that wraps the SfRadioGroup and the SfRadioButton.
Unfortunately this does not work if the test is executed on iOS. I already tried to use "IsOn", "isOn" and "IsChecked", "Checked" and "checked" instead of "isChecked".
How can I get the IsChecked value in a UI test on iOS?
Thanks!
|
<button:SfRadioButton Text="Checked RadioButton"
x:Name="radioButton" BackgroundColor="LightYellow" AutomationProperties.Name="{Binding IsChecked, Source={x:Reference radioButton}}"
AutomationId="RadioButtonAutomation" IsChecked="True"/> |
|
var result = app.WaitForElement(c => c.Id("RadioButtonAutomation"));
var checked = result[0].Label;
|