Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to trigger an Android LongClick in Xamarin UI Test

I've got a RecyclerView with a ActionMode which can be activated by a long click on a RecyclerView item.

How to trigger a long click in Android with Xamarin UI tests? AndroidApp contains a method TouchAndHold(Func query) but this one seems not to trigger a long click.

Anyone here have a solution?

My code:

   Func<AppQuery, AppQuery> test = c => c.Marked("Test");
   app.WaitForElement (test);
   app.TouchAndHold (test);
like image 245
Luciano Avatar asked Oct 01 '15 09:10

Luciano


1 Answers

TouchAndHold should trigger a LongClick.

I forgot to build a new release apk where i implemented the OnLongClick functionality. After building a new apk the TouchAndHold worked as expected

like image 99
Luciano Avatar answered Oct 16 '22 04:10

Luciano