How to run Android LongClick in Xamarin UI test

I have a RecyclerView with an ActionMode that can be activated by a long click on the RecyclerView element.

How to launch long click on Android using Xamarin UI tests? AndroidApp contains the TouchAndHold method (Func request), but this one doesn't seem to trigger a long click.

Anyone have a solution?

My code is:

Func<AppQuery, AppQuery> test = c => c.Marked("Test"); app.WaitForElement (test); app.TouchAndHold (test); 
+6
source share
1 answer

TouchAndHold should launch LongClick.

I forgot to create a new version of apk, where I implemented the OnLongClick functionality. After creating a new apk, TouchAndHold worked as expected.

0
source

All Articles