How to get the the "IsCheck" property in a UI test running on iOS

I want to write a UI test to check if a SfRadioButton is checked or not.

I'm using the SfRadioButton like this:

<buttons:SfRadioGroup x:Name="RadioGroup" AutomationId="RadioGroup" Orientation="Horizontal">

                    <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!




3 Replies 1 reply marked as answer

YP Yuvaraj Palanisamy Syncfusion Team September 15, 2020 03:26 PM UTC

Hi Mathias Jakob, 
 
We are currently working on this and we will update you the complete details on or before 17th September 2020. 
 
Regards, 
Yuvaraj 



YP Yuvaraj Palanisamy Syncfusion Team September 17, 2020 03:07 PM UTC

Hi Mathias Jakob, 
 
Currently we are facing the difficulties to achieve the requirement “Getting SfRadioButton IsChecked property value in UITestScript” and we will update the complete details on or before 22nd September 2020. 
 
Regards, 
Yuvaraj 



YP Yuvaraj Palanisamy Syncfusion Team September 23, 2020 02:57 PM UTC

Hi Mathias Jakob,  
   
Thanks for your patience.  
   
We have achieved your requirement by updating the IsChecked property value to the Xamarin.Forms AutomationProperties Name property. Please refer to the below code snippet.  
   
[Sample]  
   
<button:SfRadioButton Text="Checked RadioButton"
                              x:Name="radioButton"
                              BackgroundColor="LightYellow" 
 
                              AutomationProperties.Name="{Binding IsChecked, Source={x:Reference radioButton}}"
                              AutomationId="RadioButtonAutomation"
                              IsChecked="True"/> 
 
   
   
[TestScript]  
  
In script, you can get that same by using Label property.  
  
   
var result = app.WaitForElement(c => c.Id("RadioButtonAutomation"));  
   
var checked = result[0].Label;  
   
   
Please let us know if you need any concern.  
 
Regards, 
Yuvaraj 


Marked as answer
Loader.
Up arrow icon