Ejemplo n.º 1
0
 /// <summary>
 /// Finds the first element in the screen that matches the UiAutomator criteria using a Parent 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 ByUiAutomatorParentSelector(Share.Selector selector, string text, int position = 0)
 {
     try
     {
         var element = GetControl.ByUiAutomatorParentSelector(selector, text, position);
         element.Click();
     }
     catch (Exception ex)
     {
         Assert.Fail("ClickByUiAutomatorParentSelector threw an exception: " + ex.Message);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Finds the first element in the screen that matches the UiAutomator criteria using a Parent 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="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 ByUiAutomatorParentSelector(string inputText, Share.Selector selector, string text, int position = 0)
 {
     try
     {
         var element = GetControl.ByUiAutomatorParentSelector(selector, text, position);
         element.Clear();
         element.SendKeys(inputText);
     }
     catch (Exception ex)
     {
         Assert.Fail("InputByUiAutomatorParentSelector threw an exception: " + ex.Message);
     }
 }