Xamarin UITest – Streamlined Back Door Calls

Here’s a mini post – Making back door calls on iOS and Android is slightly different. Here’s an extension method that works on both…

 public static class AppExtensions
 {
    public static void CallBackdoorMethod(this IApp app, string method, object argument = null)
    {
        if (app is iOSApp)
        {
if (argument == null)
{
argument = "";
}
app.Invoke($"{method}:", argument);
        }
        else
        {
            app.Invoke(method, argument);
        }
    }
}
Advertisements
Xamarin UITest – Streamlined Back Door Calls

2 thoughts on “Xamarin UITest – Streamlined Back Door Calls

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s