public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var action = context.Action; var src = context.FindElement(context.Target); var dst = context.FindElement(context.Value); action.DragAndDrop(src, dst); action.Perform(); }
public static int GetActual(ITestContext context) { var element = context.FindElement(context.Target); var actual = element.Size.Width; return(actual); }
public static IEnumerable <string> GetActual(ITestContext context) { var element = context.FindElement(context.Target); var selectElement = new SelectElement(element); var optionElements = selectElement.AllSelectedOptions; return(optionElements.Select(i => i.GetAttribute("value"))); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); TestCommandHelper.AssertIsTrue(element.Selected); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var action = context.Action; action.ContextClick(context.FindElement(context.Target)); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); element.Click(); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var expected = context.Target; var actual = context.FindElement("body").Text; TestCommandHelper.AssertAreContains(expected, actual); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var action = context.Action; action.MoveToElement(element); action.Perform(); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var name = context.Value; var value = element.Selected.ToString().ToLower(); context.Set(name, value); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var name = context.Value; var value = element.GetAttribute("value"); context.Set(name, value); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var expected = context.Value; var actual = element.GetAttribute("value"); TestCommandHelper.AssertAreEqual(expected, actual); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var attributeLocator = AttributeLocator.Parse(context.Target); var element = context.FindElement(attributeLocator.ElementLocator); var attributeValue = element.GetAttribute(attributeLocator.AttributeName); context.Set(context.Value, attributeValue); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var action = context.Action; Tuple <int, int> t = context.ParseCoordString(context.Value); action.MoveToElement(element); action.MoveByOffset(t.Item1, t.Item2); action.Click(); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var selectElement = new SelectElement(element); if (0 < selectElement.AllSelectedOptions.Count) { return; } TestCommandHelper.AssertFail(); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var action = context.Action; var src = context.FindElement(context.Target); string[] offset = context.Value.Split(','); int offsetX = Convert.ToInt16(offset[0]); int offsetY = Convert.ToInt16(offset[1]); action.DragAndDropToOffset(src, offsetX, offsetY); action.Perform(); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); if (string.IsNullOrWhiteSpace(context.Value)) { element.Clear(); } else { element.SendKeys(context.Value); } }
public static IEnumerable <string> GetActual(ITestContext context) { var element = context.FindElement(context.Target); var selectElement = new SelectElement(element); var actualList = new List <string>(); for (int i = 0; i < selectElement.Options.Count(); i++) { var optionElement = selectElement.Options[i]; if (optionElement.Selected) { actualList.Add(i.ToString()); } } return(actualList); }
public static IEnumerable <string> GetActual(ITestContext context) { var element = context.FindElement(context.Target); var selectElement = new SelectElement(element); List <string> actual = new List <string>(); for (int i = 0; i < selectElement.Options.Count; i++) { var optionElement = selectElement.Options[i]; if ("true" == optionElement.GetAttribute("selected")) { actual.Add(optionElement.Text); } } return(actual); }
public static IEnumerable <string> GetActual(ITestContext context) { var element = context.FindElement(context.Target); var selectElement = new SelectElement(element); List <string> actualList = new List <string>(); for (int i = 0; i < selectElement.Options.Count; i++) { var optionElement = selectElement.Options[i]; var selected = optionElement.GetAttribute("selected"); if (Convert.ToBoolean(selected)) { actualList.Add(optionElement.GetAttribute("id")); } } return(actualList); }
public static void ExecuteInternal(ITestContext context) { if (null == context) { throw new ArgumentNullException("context"); } var element = context.FindElement(context.Target); var selectElement = new SelectElement(element); foreach (var pair in dic) { if (context.Value.StartsWith(pair.Key, StringComparison.OrdinalIgnoreCase)) { string v = context.Value.Substring(pair.Key.Length); pair.Value(selectElement, v); return; } } ByLabel(selectElement, context.Value); }
private static void ByElement(ITestContext context, string value) { var frameElement = context.FindElement(context.Target); context.Driver.SwitchTo().Frame(frameElement); }