Bug 30735 - UI tests are unable to find any Forms views using the Marked query
Summary: UI tests are unable to find any Forms views using the Marked query
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-06-03 12:38 UTC by Adam Kemp
Modified: 2015-06-05 11:48 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Adam Kemp 2015-06-03 12:38:22 UTC
The documentation (http://developer.xamarin.com/guides/cross-platform/xamarin-forms/uitest-and-test-cloud/) claims that the StyleId can be used to find a view like this:

app.Query(c => c.Marked("StyleID"))

However, that does not actually work.
Comment 1 Rui Marinho 2015-06-05 11:06:46 UTC
Hi Adam, you added this in your iOS project right:

Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {
    // http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
    if (null != e.View.StyleId) {
        e.NativeView.AccessibilityIdentifier = e.View.StyleId;

If so, did you try with a Button for example, and can you provide a simple testcase?

Comment 2 Adam Kemp 2015-06-05 11:46:10 UTC
*sigh*...no, I didn't. I missed that in the documentation.

So why is that not part of the Forms template? There's already UI-test code in the Forms template:

            // Code for starting up the Xamarin Test Cloud Agent
            #if ENABLE_TEST_CLOUD

Why not just throw this code in there too?
Comment 3 Rui Marinho 2015-06-05 11:48:55 UTC
Thanks Adam, we will look into it.