public override bool Test() { if (popAction == null) { throw new ApplicationException("Popup action cannot be empty"); } if (Actions.Count < 1) { throw new ApplicationException("Action list cannot be empty"); } bool retValue = true; IE iepop; try { popAction.Do(Wxs.Instance.Ie); if (UrlValue.Contains("*")) { iepop = IE.AttachToIE(Find.ByUrl(new Regex(UrlValue.Replace("*", String.Empty)))); } else { iepop = IE.AttachToIE(Find.ByUrl(UrlValue)); } Wxs.Instance.Log.InfoFormat("Attached to it! {0}", iepop.Text); foreach (wxAction action in Actions) { action.Do(iepop); } foreach (wxVerifier ver in Verifications) { if (ver.Verify()) { Wxs.Instance.Log.InfoFormat("Verification {0} passed", ver.Name); } else { retValue = false; Wxs.Instance.Log.WarnFormat("Verification {0} failed!", ver.Name); } } } catch (Exception ex) { Wxs.Instance.Log.ErrorFormat("Error on PopTest {0}: {1}", Name, ex.Message); return(false); } iepop.Close(); return(retValue); }
/// <summary> /// /// </summary> /// <returns></returns> public override bool Test() { if (submitAction == null) { Wxs.Instance.Log.Error("Null submit action, will not execute test"); return(false); } // Submit Form submitAction.Do(Wxs.Instance.Ie); //Wxs.Instance.Ie.Forms[0].Submit(); // check if we are done, if not, if (!Wxs.Instance.Ie.ContainsText(FinishText)) { if (Wxs.Instance.Ie.ContainsText(UnfinishedText)) { CompleteForm(); } Test(); } return(true); }