/// <summary> /// Finds a collection of elements in the screen that matches the UiAutomator criteria using a UiSelector and click it. /// </summary> /// <param name="selector"> Represents the Enum in Share class </param> /// <param name="value"> the boolean value of an element to be found </param> /// <param name="text"> text to found the element to be click</param> /// <param name="position"> position of an object on the layout hierarchy </param> public static void CollectionByUiAutomatorSingleSelector(Share.Selector selector, bool value, string text, int position = 0) { try { var elements = GetControl.CollectionByUiAutomatorSingleSelector(selector, value, position); foreach (var element in elements) { if (element.Text.Contains(text)) { element.Click(); } } } catch (Exception ex) { Assert.Fail("ClickCollectionByUiAutomatorSingleSelector threw an exception: " + ex.Message); } }