We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Impossible to control SfPicker by Xamarin.UITest (iOS platform)

Dear Expert,

Can you explain to me for understanding why is not possible to use Xamarin.UITest to click on OK button in order to close the picker after choosing values? 

Because the Picker will disappear immediately when querying “OK” button to tap on, so it’s impossible to tap it. 

I am working on:

- Xamarin.UITest 3.0

- iPhone's iOS 12.2

- Syncfusion

The method used to tap “OK” button: app.Tap(c => c.Text("OK"))

It's very strange because we can use Xamarin.UITest to flash "OK" button, but we cannot tap on it.

We also try another way to tap by:

- find the coordinate of OK button

- use Xamarin.UITest to TapCoordinate, but the Picker still disappear.

Thank you a lot!

7 Replies

JK Jeya Kasipandi Syncfusion Team June 15, 2019 06:05 AM UTC

Hi Hung,

We have validated your query , While automation scripts  are running ,coordinates get tapped outside of the picker dialog window so it gets closed automatically before the ok button is selected.

We have created  a sample to solve this and please find the sample from below link

Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/PickerAutomationSample-1136644085

In this sample, we have raised closed event to  avoid the picker get closed when tapping coordinates outside of the picker dialog as like below code snippet


   pickerControl.Closed += PickerControl_Closed;
void PickerControl_Closed(object sender, EventArgs e)
if (!opened)
                pickerControl.IsOpen = 


Please get back us, if you have any concern.


Jeya k.


HU hung June 24, 2019 03:56 AM UTC

Thanks @Jeya Kasipandi a lot for your explanation.
I will update you as soon as possible.

MK Muneesh Kumar G Syncfusion Team June 24, 2019 12:35 PM UTC

Hi Hung, 
Thanks for your update and we will wait to hear from you. 
Muneesh Kumar G. 

SR Scott Roberts September 23, 2019 06:07 PM UTC

Hi Muneesh,

I am facing the same issue, but with a Xamarin Forms app.   I was to run your solution successfully, however I made once change to reset the opened flag otherwise the code only works successfully on the first button click and not subsequent ones:

   void Button_TouchUpInside(object sender, EventArgs e)
            pickerControl.IsOpen = !pickerControl.IsOpen;
            opened = false;   // I added this line

However, I am unable to get a Forms version of the app working as setting the IsOpen = true in the picker closed event having no effect (the modal still closes).   Would it be possible to provide me with a Xamarin Forms version of your solution?   


I am using 
- Syncfusion
-iPhone iOS Simulator 12.2
- Xamarin.Forms v4.2.0.815419

MK Muneesh Kumar G Syncfusion Team September 25, 2019 09:01 AM UTC

Hi Scott,

Greetings from Syncfusion. 
We can able to reproduce the reported issue "Picker dialog get closed when the user clicks outside of the dialog after setting IsOpen to true in Xamarin.Forms iOS " and we have fixed the reported issue. Please find the patch for this issue from below location. 
Assembly Version: v17.2.0.51 
Please note that we have created this patch for the version v17.2.0.51 specifically to resolve the issue reported in this. 
This fix will be included in our upcoming volume 3 main release which will be available on end of September 2019. 
Muneesh Kumar G.  

SP sucharitha podduturi November 14, 2019 12:04 PM UTC

I have downloaded the syncfusion picker and integrated to my code its working fine on android but its not working iOS(I mean its showing a blank page).

HM Hemalatha Marikumar Syncfusion Team November 15, 2019 07:02 AM UTC

Hi Sucharitha podduturi,  
We would like to let you know that you can resolve this as per in below code snippet 
Code snippet [C#]:  
public override bool FinishedLaunching(UIApplication app, NSDictionary options)  
            LoadApplication(new App());  
           Syncfusion.SfPicker.XForms.iOS .SfPickerRenderer.Init();  
            return base.FinishedLaunching(app, options);  
Please let us know if you have any other concerns 
Hemalatha M. 

Live Chat Icon For mobile
Up arrow icon