Configuring backdoor methods in C# for Xamarin Test Cloud

One of the most powerful mechanisms we offer in Xamarin Test Cloud is the ability to invoke specific code in your application from your UI Tests. This is called invoking a backdoor method.

Like the Xamarin Test Cloud Agent for iOS, backdoors should never be enabled in your release build as they could pose a security risk. Your test/debug build should have all the backdoors and configuration needed for proper UI testing.

Let’s say I’ve built a Xamarin.Forms application that simply loads a WebView, and I want to control the loaded URL via a backdoor method. In other words, I want the test to control what gets loaded in the WebView.

iOS

On iOS, the method signature for a backdoor method needs to look like this: