Exemple #1
0
        public static void init(this appiumHelper.appiumTestCase _tc)
        {
            var appID = _tc.caseXml.XPathSelectElement("//ParamBinding[@name='applicationID']");

            string ID = appID.Attribute("value").Value;

            if (string.IsNullOrEmpty(ID))
            {
                ID = "null";
            }


            var app = testHelper.rc.GetApk(ID);

            _tc.app = app.iosPackeg;
        }
Exemple #2
0
        private List <phoneDriver> getPhoneList()
        {
            List <phoneDriver> pdl = new List <phoneDriver>();

            string devices = testHelper.ExeCommand("adb devices");



            foreach (Match mch in Regex.Matches(devices, "\\r\\n.*\\tdevice"))
            {
                String x = mch.Value;
                x = x.Substring(0, x.LastIndexOf("device"));
                phoneDriver pd = new phoneDriver(x.Trim());
                pd.IP = this.IP;
                pdl.Add(pd);
            }

            foreach (phoneDriver pd in pdl)
            {
                string cmd = string.Format("adb -s {0} shell getprop ro.product.model", pd.device);
                pd.model = testHelper.ExeCommand(cmd).Trim();
            }

            try
            {
                XElement config = XElement.Load("config.xml");
                foreach (XElement x in config.Elements("appium"))
                {
                    phoneDriver ad = new phoneDriver();
                    ad.IP     = this.IP;
                    ad.model  = x.Attribute("model").Value;
                    ad.device = x.Attribute("device").Value;
                    appiumHelper.appiumTestCase caseHelper = new appiumHelper.appiumTestCase();
                    caseHelper.url  = x.Attribute("url").Value;
                    caseHelper.udid = ad.device;//udid
                    ad.caseHelper   = caseHelper;
                    pdl.Add(ad);
                }
            }
            catch { }

            return(pdl);
        }