Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="step"></param>
        /// <param name="ex"></param>
        /// <returns></returns>
        private StepResult Fail(TestStep step, Exception ex)
        {
            SaveScreenshot(step.FileName);
            StepResult r = new StepResult()
            {
                Pass = false,
                Step = string.Format("{0}, {1}", step.Action, step.ActionValue),
                Note = (ex != null) ? ex.Message : ""
            };

            if (ex != null)
            {
                LoggerUtil.Log(ex, LogLevel.Error);
            }
            // return r;
            throw (ex);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="step"></param>
        /// <returns></returns>
        public StepResult ProcessRow(TestStep step)
        {
            StepResult r = new StepResult();

            switch (step.Action.ToLower())
            {
            case "clear":
                r = stepActions.ClearAction(step);
                break;

            case "click":
                r = stepActions.ClickAction(step);
                break;

            case "clicklocation":
                r = stepActions.ClickLocationAction(step);
                break;

            case "close":
                r = stepActions.CloseAction(step);
                break;

            case "dropdownselectbytext":
                r = stepActions.DropdownSelectByTextAction(step);
                break;

            case "execute":
                throw new NotImplementedException();

            // r = ExecuteAnotherTable(r, step.Action, step.ActionValue);
            // break;
            case "find":
                r = stepActions.FindAction(step);
                break;

            case "findnot":
                r = stepActions.FindNotAction(step);
                break;

            case "findsafe":
                r = stepActions.FindSafeAction(step);
                break;

            case "findtextonpage":
                r = stepActions.FindTextOnPage(step);
                break;

            case "isnotvisible":
                r = stepActions.IsNotVisible(step);
                break;

            case "isvisible":
                r = stepActions.IsVisible(step);
                break;

            case "gettitle":
                r = stepActions.GetTitleAction(step);
                break;

            case "navigate":
                r = stepActions.NavigateAction(step);
                break;

            case "nexttab":
                r = stepActions.NextTab(step);
                break;

            case "read":
                r = stepActions.ReadAction(step);
                break;

            case "screenshot":
                r = stepActions.ScreenshotAction(step);
                break;

            case "sendkey":
                r = stepActions.SendKeyAction(step);
                break;

            case "sendtext":
                r = stepActions.SendTextAction(step);
                break;

            case "valuecopy":
            case "valuesave":
                _valueCopy = stepActions.CopyValueAction(step).Note;
                break;

            case "valuepaste":
                step.ActionValue = _valueCopy;
                r = stepActions.SendTextAction(step);
                break;

            case "wait":
                r = stepActions.Wait(step);
                break;

            case "waitforpreloader":
                r = stepActions.WaitForPreLoader(step);
                break;

            case "waituntilvisible":
                r = stepActions.WaitUntilVisible(step);
                break;

            case "dictionarycopy":
                _dict = stepActions.DictionaryCopy(step);
                break;

            default:
                LoggerUtil.Log(new NotImplementedException(), LogLevel.Error);
                break;
            }
            return(r);
        }