/// <summary> /// Finds the first element in the screen that matches the UiAutomator criteria using a Child UiSelector and click it. /// </summary> /// <param name="selector"> Represents the Enum in Share class </param> /// <param name="text"> the partial/complete text of an element to be found </param> /// <param name="position"> position of an object on the layout hierarchy </param> public static void ByUiAutomatorChildSelector(Share.Selector selector, string text, int position = 0) { try { var element = GetControl.ByUiAutomatorChildSelector(selector, text, position); element.Click(); } catch (Exception ex) { Assert.Fail("ClickByUiAutomatorChildSelector threw an exception: " + ex.Message); } }
// ************ DATE 10/16/2020 ************ // All the possible Selectors to search for a child element till date. // ************ --------------- ************ #region USING CHILD SELECTORS /// <summary> /// Finds the first element in the screen that matches the UiAutomator criteria using a Child UiSelector and then simulates typing text into the element. /// </summary> /// <param name="inputText">The text to type into the element.</param> /// <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</param> /// <param name="position"> position of an object on the layout hierarchy </param> public static void ByUiAutomatorChildSelector(string inputText, Share.Selector selector, bool value, string text, int position = 0) { try { var element = GetControl.ByUiAutomatorChildSelector(selector, value, position); element.Clear(); element.Click(); } catch (Exception ex) { Assert.Fail("InputByUiAutomatorChildSelector threw an exception: " + ex.Message); } }