示例#1
0
        public static void StartProcessWithFormAndControl(
            UIAutomationTestForms.Forms formCode,
            TimeoutsAndDelays formDelayEn,
            System.Windows.Automation.ControlType controlType,
            string controlName,
            string controlAutomationId,
            TimeoutsAndDelays controlDelayEn)
        {
            var controlToForm =
                new ControlToForm(
                    controlType,
                    controlName,
                    controlAutomationId,
                    controlDelayEn);

            // 20150322

            /*
             * var arr = new System.Collections.ArrayList();
             * arr.Add(controlToForm);
             *
             * StartProcessWithFormAndControl(
             *  formCode,
             *  formDelayEn,
             *  ((ControlToForm[])arr.ToArray(typeof(ControlToForm))));
             */
            var arr = new ArrayList {
                controlToForm
            };

            StartProcessWithFormAndControl(
                formCode,
                formDelayEn,
                ((ControlToForm[])arr.ToArray(typeof(ControlToForm))));
        }
示例#2
0
        public static void StartProcessWithFormAndControl(
            UIAutomationTestForms.Forms formCode,
            TimeoutsAndDelays formDelayEn,
            object[] controlToForm)
        {
            int formDelay = (int)formDelayEn;

            var controlToFormConverted = (ControlToForm[])controlToForm;

            TestProcessStartInfo.Arguments       = ((int)formCode).ToString();
            TestProcessStartInfo.CreateNoWindow  = true;
            TestProcessStartInfo.UseShellExecute = false;
            TestProcessStartInfo.LoadUserProfile = false;
            // form delay
            TestProcessStartInfo.Arguments += " ";
            TestProcessStartInfo.Arguments += formDelay.ToString();

            if (controlToFormConverted.Length > 0)
            {
                foreach (ControlToForm currentForm in controlToFormConverted)
                {
                    // control type
                    TestProcessStartInfo.Arguments += " ";
                    var controlType =
                        currentForm.ControlType.ProgrammaticName.Substring(
                            currentForm.ControlType.ProgrammaticName.IndexOf(".") + 1);
                    TestProcessStartInfo.Arguments += controlType;

                    // control delay
                    int controlDelay = (int)currentForm.ControlDelayEn;
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments += controlDelay;
                    //controlToFormConverted[i].ControlDelayEn.ToString();

                    // control name
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments += currentForm.ControlName;

                    // control AutomationId
                    TestProcessStartInfo.Arguments += " ";
                    TestProcessStartInfo.Arguments += currentForm.ControlAutomationId;
                }
            }

            Console.WriteLine(
                TestFormPath +
                " " +
                TestProcessStartInfo.Arguments);
            TestProcess = Process.Start(TestProcessStartInfo);
        }
示例#3
0
        public static void StartProcessWithForm(UIAutomationTestForms.Forms formCode,
                                                TimeoutsAndDelays formDelayEn)
        {
            var formDelay = (int)formDelayEn;

            TestProcessStartInfo.Arguments       = ((int)formCode).ToString();
            TestProcessStartInfo.CreateNoWindow  = true;
            TestProcessStartInfo.UseShellExecute = false;

            TestProcessStartInfo.Arguments += " ";
            TestProcessStartInfo.Arguments += formDelay.ToString();

            Console.WriteLine(
                TestFormPath +
                " " +
                TestProcessStartInfo.Arguments);
            TestProcess = Process.Start(TestProcessStartInfo);
        }