Ejemplo n.º 1
0
        // ************ DATE 10/16/2020 ************
        // ***** IMPORTANT: All Click by XPATH will search an element and then click it.
        // ************ --------------- ************
        #region BY XPATH


        /// <summary>
        /// Finds the first element in the screen that matches the xPath criteria and then click it.
        /// </summary>
        /// <param name="position">Position to match a specific element</param>
        /// <param name="elem">Represents the Enum in Share class</param>
        /// <param name="widget">boolean if this is a widget</param>
        public static void ByXPath(int position, Share.Element elem = Share.Element.EditText, bool widget = true)
        {
            try
            {
                AppiumWebElement element = GetControl.ByXPath(position, elem, widget);
                element.Click();
            }
            catch (Exception ex)
            {
                Assert.Fail("ClickByXPath threw an exception: " + ex.Message);
            }
        }