private void StartAUT()
        {
            seqGUIUT = new GUITestUtility.GUIInfoSerializable();
            object obj = (object)seqGUIUT;

            GUITestUtility.DeSerializeInfo(guiTestDataStore, ref obj);
            seqGUIUT = (GUITestUtility.GUIInfoSerializable)obj;

            string AUTPath     = seqGUIUT.AUTPath;
            string startupType = seqGUIUT.AUTStartupForm;

            if (AUT == null)
            {
                AUT = (Form)GUITestUtility.StartAUT(AUTPath, startupType);
            }

            int           hwnd      = (int)AUT.Handle;
            StringBuilder sbClsName = new StringBuilder(128);

            GUITestActions.GetClassName(hwnd, sbClsName, 128);
            string clsName = sbClsName.ToString();
            string winText = AUT.Text;
            string pText   = "";

            GUITestActions.SynchronizeWindow(ref hwnd, ref winText, ref clsName, ref pText);
        }
        //chapter 8
        private void AddTestVerification()
        {
            if (AUT == null)
            {
                return;
            }

            string VerifyDataStore = guiTestDataStore.Replace(".xml", "_verify.xml");

            TypeVerificationSerializable verifyTypes = new TypeVerificationSerializable();
            object obj = (object)verifyTypes;

            GUITestUtility.DeSerializeInfo(VerifyDataStore, ref obj);
            verifyTypes = (TypeVerificationSerializable)obj;

            TypeVerification oneType  = (TypeVerification)verifyTypes.TypeList[clickNum - 1];
            object           resulted = null;

            foreach (TestExpectation fieldName in oneType.MemberList)
            {
                TestExpectation tested = fieldName;
                try
                {
                    resulted       = GUITestUtility.VerifyField(AUT, tested.VerifyingMember);
                    tested.isField = true;
                }
                catch (Exception ex4)
                {
                    resulted          = GUITestUtility.VerifyProperty(AUT, tested.VerifyingMember);
                    tested.isProperty = true;
                }
                VerifyAlphanumericResult(ref tested, resulted);
                VerifyClipboard(ref tested, resulted);
            }
        }
Beispiel #3
0
        private void StartNonDotNetAUT()
        {
            seqGUIUT = new GUITestUtility.GUIInfoSerializable();
            object obj = (object)seqGUIUT;

            GUITestUtility.DeSerializeInfo(guiTestDataStore, ref obj);
            seqGUIUT = (GUITestUtility.GUIInfoSerializable)obj;

            GUITestUtility.StartAUTAsProcess(seqGUIUT.AUTPath, "");
        }
Beispiel #4
0
        private void StartAUT()
        {
            seqGUIUT = new GUITestUtility.GUIInfoSerializable();
            object obj = (object)seqGUIUT;

            GUITestUtility.DeSerializeInfo(guiTestDataStore, ref obj);
            seqGUIUT = (GUITestUtility.GUIInfoSerializable)obj;

            string AUTPath     = seqGUIUT.AUTPath;
            string startupType = seqGUIUT.AUTStartupForm;

            int hwnd = 0;

            if (AUT == null)
            {
                try                 //chapter 13
                {
                    AUT  = (Form)GUITestUtility.StartAUT(AUTPath, startupType);
                    hwnd = (int)AUT.Handle;
                }
                catch (InvalidCastException ex)                 //chapter 13
                {
                    AUT = GUITestUtility.StartControlUT(AUTPath, startupType);
                    AUT.Show();
                    Control ctrlAUT = AUT.Controls[0];
                    hwnd = (int)ctrlAUT.Handle;
                }
            }

            //int hwnd = (int)AUT.Handle;

            StringBuilder sbClsName = new StringBuilder(128);

            GUITestActions.GetClassName(hwnd, sbClsName, 128);
            string clsName = sbClsName.ToString();
            string winText = AUT.Text;
            string pText   = "";

            GUITestActions.SynchronizeWindow(ref hwnd, ref winText, ref clsName, ref pText);
        }