Bug 60050 - Xamarin UI Test: Tap() method not triggering when doing UI test using triggers and behaviors (in my case)
Summary: Xamarin UI Test: Tap() method not triggering when doing UI test using trigger...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
: 60074 ()
Depends on:
Reported: 2017-10-09 04:07 UTC by developer.lorenz
Modified: 2017-10-14 16:13 UTC (History)
2 users (show)

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

XAML screenshot of the page that includes the button used for the Tap() method in the UI test. (34.04 KB, image/png)
2017-10-09 04:07 UTC, developer.lorenz
UI Test code screenshot (4.83 KB, image/png)
2017-10-09 04:09 UTC, developer.lorenz

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 developer.lorenz 2017-10-09 04:07:37 UTC
Created attachment 25211 [details]
XAML screenshot of the page that includes the button used for the Tap() method in the UI test.

I'm currently working with UI Testing with Xamarin UI Test. I'm currently having a problem with the Tap() method with my test, below is my current scenario.

Enter phone number in the textbox and then button will be enabled once the text box is not empty and should trigger the Tap("ButtonName") method when doing the UI test.

Button uses triggers and behaviors(Data triggers to be specific) and the button's state(enabled/disabled) depends on the textbox's state whether its empty or not.

The Tap() method for the button is not triggered when running the UI test even when the textbox is already filled with data.

Is this a bug for on the UI test part?

I find it weird because the Tap() method is triggered when it is the only method in the test method. Please check the attached files for reference.
Comment 1 developer.lorenz 2017-10-09 04:09:57 UTC
Created attachment 25212 [details]
UI Test code screenshot
Comment 2 Paul DiPietro [MSFT] 2017-10-09 04:29:53 UTC
What version of Forms are you running, and what platform is exhibiting the issue?
Comment 3 developer.lorenz 2017-10-09 04:41:32 UTC
I'm using Xamarin.Forms v2.3.4.247. I'm currently testing on the Android platform.

One thing I find weird is that when I created a new xamarin forms project without using the behaviors and triggers the UI test works fine.
Comment 4 developer.lorenz 2017-10-10 04:46:17 UTC
Xamarin team, do you already an update about the issue I posted? Hope you'll have an update soon. Thanks!
Comment 5 Paul DiPietro [MSFT] 2017-10-10 11:15:24 UTC
*** Bug 60074 has been marked as a duplicate of this bug. ***
Comment 6 Paul DiPietro [MSFT] 2017-10-10 11:23:26 UTC
Please try to avoid filing duplicate reports. If the issue still occurs on 2.4.0 stable, please provide a reproduction project we can run to help investigate this issue. Please also verify if the issue only occurs when running UI tests. When updating, it also helps to clean/rebuild the project as well as delete any bin/obj folders.
Comment 7 developer.lorenz 2017-10-11 01:39:25 UTC
Thank you for your response, my apologies for that.

Currently I'm still stuck with the issue only during the UI test. Everything works fine when doing manual tests(e.g. QA).

I've also made a new Xamarin.Forms project with the same behavior/feature of the project I'm doing UI tests with and fortunately everything works fine during the UI test. I suspect that there is something wrong with our code or something. Still debugging the issue.
Comment 8 developer.lorenz 2017-10-11 08:18:31 UTC
Here's a link to the sample project.

Comment 9 developer.lorenz 2017-10-12 03:36:45 UTC
After running a few test runs I noticed that the issue is in the entertext() method since when running the UI test it enters some data into the text field and after a few seconds the "focus" goes back to the text field instead of tapping the button.

The button is working when tapped(manually, not UI test) even after running the test so I think that the problem is in text field and not the button.