I am writing a Xamarin.UITest for a cross-platform Xamarin.iOS and Xamarin.Android app.
In my Xamarin.UITest, how do I verify the following properties:
- On Xamarin.Android, how can I verify the
Hintproperty for anEditText? - On Xamarin.iOS, how can I verify the
Placeholderproperty for aUITextField?
Sample Code
Sample App
Here is the same code-snippet in a sample app that demostrates how to accomplish this task in a cross-platform Xamarin.UITest:
https://github.com/brminnick/FaceOff/blob/master/UITests/Pages/WelcomePage.cs#L73
Explaination
In Xamarin.UITest, to retrieve text from an Android
EditTextor a iOSUITextField, you must use theInvokemethod to access the native Java Android API and native ObjectiveC iOS API. In ourInvokestatements, we can take advantage of the native methods (getHint()on Android, andplaceholderon iOS) to retrieve the string.All tests were validated via Xamarin Test Cloud. The test report is viewable here.