public static bool Assert(UI.UIAssertAction action, OpenQA.Selenium.IWebDriver webDriver)
        {
            By locator = SeleniumUIHelper.GetBy(action.Element);

            OpenQA.Selenium.IWebElement element = SeleniumUIHelper.GetElement(webDriver, locator);
            switch (action.AssertType)
            {
            case UIActionSeertType.Text:
                return(CheckTextAssert(element, action));

            case UIActionSeertType.CssClass:
                return(CheckCssClassAssert(element, action));

            case UIActionSeertType.Count:
                System.Collections.ObjectModel.ReadOnlyCollection <IWebElement> elements = SeleniumUIHelper.GetElements(webDriver, locator);
                return(CheckCountElementAssert(elements, action));

            case UIActionSeertType.Browser:
                return(CheckBrowserAssert(webDriver, action));

            case UIActionSeertType.Exist:
            default:
                return(CheckExistAssert(element, action));
            }
        }
 public void Assert(UI.UIAssertAction action)
 {
     try
     {
         action.Status = SeleniumUIHelper.Assert(action, this.Driver) ? TestResultType.Success : TestResultType.Fail;
     }
     catch (System.Exception)
     {
         action.Status = TestResultType.Fail;
         string fileName = string.Format("{0}_{1}_{2}.png", action.TestCaseAction.TestCase.TestCaseRef.Key, action.TestCaseAction.ActionRef.Action, System.DateTime.Now.ToString("yyyyMMddHHmmssms"));
         SeleniumScreenshotHelper.CreateScreenshot(this.Driver, this.TestRunner.Environment, fileName);
         action.Error = new ValidationException("Common.ElementCanNotFound", action.Element, fileName);
     }
 }
 public void Input(UI.UIInputAction action)
 {
     try
     {
         action.Status = TestResultType.Fail;
         OpenQA.Selenium.IWebElement element = SeleniumUIHelper.GetElement(this.Driver, SeleniumUIHelper.GetBy(action.Element));
         element.Clear();
         element.SendKeys(action.Value);
         action.Status = TestResultType.Success;
     }
     catch (System.Exception)
     {
         action.Status = TestResultType.Fail;
         string fileName = string.Format("{0}_{1}_{2}.png", action.TestCaseAction.TestCase.TestCaseRef.Key, action.TestCaseAction.ActionRef.Action, System.DateTime.Now.ToString("yyyyMMddHHmmssms"));
         SeleniumScreenshotHelper.CreateScreenshot(this.Driver, this.TestRunner.Environment, fileName);
         action.Error = new ValidationException("Common.ElementCanNotFound", action.Element, fileName);
     }
 }