I am attempting to write some useful Ui-tests with Xamarin.UITest and have lately been trying to figure out a way to change the application’s state in between tests. This is in order to test app behavior in different scenarios where certain elements, object or components are either present, empty or missing.
One of the solutions that I have been trying to implement is the use of backdoor methods, that lets you invoke actions and change of state on the device during a test run. However, I seem to have a great deal of trouble getting the backdoor to react with the binding variables of the app.
Furthermore, is that I have not been able to find any practical examples or guides on how to change state whilst running tests on the app. At times it almost seems as if it is not a possible to do at all. The Microsoft documentation explain that state change during tests is one of the main purposes of these backdoor methods.
The documentation gives an overall understanding of how backdoors can be set up but does not go in depth about the contents of the backdoors. It explains how to access the backdoor method, but not what kind of work I need to do in order to interact with the state of my app.
What I need help with:
I need to figure out what to write in the backdoor method in order to modify/change with the state of my app during testing.
I want to interact with binding variables like these from the Xamarin.Forms template app:
I have not been able to find any examples on how to go about doing this whatsoever, or if it’s even possible this way. Any type of help is most appreciated.