o_w
o_w

Reputation: 683

How to select an item in UIPickerView

In Xamarin test on Mac, I'm running a test where a picker is opened and the user selects one of two items inside.

For some reason this line:

if (platform == Platform.iOS)
{
    //Invoke the native method selectRow() 
    app.Query(x => x.Class("UIPickerView").Invoke("selectRow", "[value_name]", "inComponent", 0, "animated", true));
}

Where [value_name] is the value of either of two items, Doesn't work.

There is even MSFT doc for it: https://learn.microsoft.com/en-us/appcenter/test-cloud/frameworks/uitest/features/date-time-pickers

And yet it will not work.

Can anyone share how they got this to work?

Using:

Visual Studio for Mac Version 8.10.10

iPhone 12 iOS 15.0 Simulator

Xamarin.UITest Nuget Version 3.2.2

Upvotes: 1

Views: 128

Answers (0)

Related Questions