private void GetSelectedMembers(GUITestDataCollector guiTDC, int guiSeq, ref TypeVerification typeVerify) { int itemCounter = 0; string typeMember = ""; string[] expectedItems = GetExpectedOutcome(guiTDC.txtExpectedResult); for (int i = 0; i < guiTDC.chckLstMembersToVerify.Items.Count; i++) { if (guiTDC.chckLstMembersToVerify.GetItemChecked(i)) { typeMember = guiTDC.chckLstMembersToVerify.GetItemText(guiTDC.chckLstMembersToVerify.Items[i]); if (!typeMember.StartsWith("\t")) { typeVerify.TypeName = typeMember; typeVerify.GUIEvent = GUIEvent; } else { TestExpectation individualTest = new TestExpectation(); individualTest.EventMember = GUIEvent; individualTest.VerifyingMember = typeMember.Trim(); individualTest.ExpectingResult = expectedItems[itemCounter]; individualTest.GUIActionSequence = guiSeq; itemCounter++; typeVerify.MemberList.Add(individualTest); } } } }
//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); } }
public void BuildVerificationList(GUITestDataCollector guiTDC, int guiSeq, ref TypeVerificationSerializable TypesToVerify) { TypesToVerify.AUTPath = AUT; TypesToVerify.AUTStartupForm = StartForm; TypeVerification typeVerify = new TypeVerification(); GetSelectedMembers(guiTDC, guiSeq, ref typeVerify); TypesToVerify.TypeList.Add(typeVerify); }
private void tmrAutomatedTest_Tick(object sender, System.EventArgs e) { StartAUT(); tmrAutomatedTest.Enabled = false; tmrRunScript.Enabled = true; //resultList = new ArrayList(); testResult = new TypeVerification(); testResult.AUTPath = seqGUIUT.AUTPath; testResult.TypeName = seqGUIUT.AUTStartupForm; }
private void tmrAutomatedTest_Tick(object sender, System.EventArgs e) { try { StartAUT(); } catch (NullReferenceException nullEx) { StartNonDotNetAUT(); } tmrAutomatedTest.Enabled = false; tmrRunScript.Enabled = true; //resultList = new ArrayList(); testResult = new TypeVerification(); testResult.AUTPath = seqGUIUT.AUTPath; testResult.TypeName = seqGUIUT.AUTStartupForm; }