Bug 33133 - DisplayAlert and DisplayActionSheet do not support StyleId for use in automated testing using UITest
Summary: DisplayAlert and DisplayActionSheet do not support StyleId for use in automat...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.4
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-08-15 06:33 UTC by John Hardman
Modified: 2017-06-16 16:22 UTC (History)
10 users (show)

Tags: DisplayAlert DisplayActionSheet StyleId UITest
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 John Hardman 2015-08-15 06:33:32 UTC
Neither DisplayAlert nor DisplayActionSheet provide any way for the developer to apply StyleId values to the displayed elements/buttons. As a result, automated testing using UITest has to rely on testing for displayed strings, which change when apps are localised for different languages. Far from ideal.

A mechanism is required that allows StyleId values to be associated with each displayed element in DisplayAlert and DisplayActionSheet.
Comment 1 asimk 2015-08-26 10:55:25 UTC
I have checked this issue by following the steps mentioned below:

1. Create Xamarin.forms application.
2. Open .cs file as shown in screencast.
3. create object of class Page.

I observed that I am not getting any StyleId parameter in methods DisplayActionSheet and DisplayAlert.

Screencast: http://www.screencast.com/t/Syng681We

Could you please have a look on the above screencast and let us know if we need to check any thing else to confirm this issue?

Environment info:
=== Xamarin Studio ===

Version 5.9.6 (build 20)
Installation UUID: 449f40dd-b3f1-4028-9a6b-cca0d1a2307d
 Mono 4.0.4 ((detached/5ab4c0d)
 GTK+ 2.24.23 (Raleigh theme)

 Package version: 400040001

=== Apple Developer Tools ===

Xcode 6.4 (7720)
Build 6E35b

=== Xamarin.Mac ===

Version: (Enterprise Edition)

=== Xamarin.Android ===

Version: (Enterprise Edition)
Android SDK: /Users/360logicaxamarinmacmini/Library/Developer/Xamarin/android-sdk-mac_x86
 Supported Android versions:
  2.3   (API level 10)
  4.0.3 (API level 15)
  4.4   (API level 19)
  5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

=== Xamarin Android Player ===

Version: Unknown version
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: (Enterprise Edition)
Hash: 6757279
Branch: master
Build date: 2015-08-24 15:04:27-0400

=== Build Information ===

Release ID: 509060020
Git revision: 0aef1c7aabdcce6c728e907e0bb13b5626f7b977
Build date: 2015-08-25 04:48:19-04
Xamarin addins: f4e5c33785602ddec4b4ab64b4e078cdeb36fa41

=== Operating System ===

Mac OS X 10.10.0
Darwin 360LogicasMacmini.local 14.0.0 Darwin Kernel Version 14.0.0
    Fri Sep 19 00:26:44 PDT 2014
    root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
Comment 2 John Hardman 2015-08-26 11:48:47 UTC
The screencast does the job fine. You could fire up app.Repl() in Xamarin.UITest to demonstrate what it shows, but that is not essential, the screencast proves the point.
Comment 3 Chris King 2016-04-13 19:06:14 UTC
Feature to add AutomationId to DisplayActionSheet
Comment 4 Samantha Houts [MSFT] 2016-05-28 01:08:24 UTC
Thank you for taking the time to submit this feature request. We like this idea and have added it to our internal feature tracking system.

Warm regards,
Xamarin Forms Team
Comment 5 John Hardman 2017-04-10 14:19:42 UTC
As per the thread at https://forums.xamarin.com/discussion/92793/automationid-on-alertboxes#latest , DisplayAlert and DisplayActionSheet still do not support automated testing. When will AutomationId be supported for DisplayAlert and DisplayActionSheet?
Comment 6 David Ortinau [MSFT] 2017-06-16 16:22:16 UTC

I don't have a timeframe to give you for when we'll investigate adding this. 

If anyone is interested in seeing this added, it sounds like a good case for an Evolution Proposal. We welcome this contribution.