コード例 #1
0
        private void SelectCategory(NcpAppElement categoryElement)
        {
            string         category1Name = categoryElement.Attributes["category1Name"];
            AndroidElement c1Node        = AppAccess.GetElementByXPath("//android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.LinearLayout[1]/android.widget.ListView/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.TextView[1]", new string[] { category1Name }, true);

            c1Node.Click();

            Thread.Sleep(1500);

            List <AppiumWebElement> cElements = this.GetCategoryElement(categoryElement.Name);
            AppiumWebElement        cElement  = cElements[cElements.Count - 1];
            Point point = cElement.Location;
            Size  size  = cElement.Size;

            //点击文字上方的图标
            AppAccess.Tap(1, point.X + size.Width / 2, point.Y - 80, 100);
            //cagtegoryElement.Click();
        }