public ClickAction(AutomationAction automationActionData) : base(automationActionData) { this.Click = GetAttributeValue<bool>("click"); this.ClickNew = GetAttributeValue<bool>("clicknew"); this.MouseClick = GetAttributeValue<bool>("mouseclick"); }
public ScrollAction(AutomationAction automationActionData) : base(automationActionData) { this.Position = GetAttributeValue<Position>("position"); this.Offset = GetAttributeValue<int>("offset"); this.Period = GetAttributeValue<int>("period", 500); this.Factor = GetAttributeValue<int>("factor", 0); }
public TextAction(AutomationAction automationActionData) : base(automationActionData) { this.Attrbute = this.GetAttributeValue<string>("text_attr"); this.AttrbuteRegex = this.GetAttributeValue<string>("text_attr_regex"); this.TextSaveKey = this.GetAttributeValue<string>("textSaveDatakey"); this.TextGetKey = this.GetAttributeValue<string>("textGetDatakey"); }
public void Add(AutomationAction action) { if (this.ActionList == null) { this.ActionList = new List<AutomationAction>(); } this.ActionList.Add(action); }
public void Test_LoadBrowserAction() { AutomationAction actionConfig = new AutomationAction(); actionConfig.Type = "Mouse"; IAction action = ClassLoader.LoadAction(actionConfig); Assert.IsNotNull(action); Assert.AreEqual(action.ActionType, ActionType.MouseAction); }
public MouseAction(AutomationAction automationActionData) : base(automationActionData) { this.Click = GetAttributeValue<bool>("click"); this.ClickNew = GetAttributeValue<bool>("clicknew"); this.MouseClick = GetAttributeValue<bool>("mouseclick"); this.Over = GetAttributeValue<bool>("over"); this.OverNew = GetAttributeValue<bool>("overnew"); this.Down = GetAttributeValue<bool>("down"); this.Up = GetAttributeValue<bool>("up"); this.Focus = GetAttributeValue<bool>("focus"); this.Move = GetAttributeValue<bool>("move"); this.MoveNew = GetAttributeValue<bool>("movenew"); this.MoveEnter = GetAttributeValue<bool>("moveenter"); }
public void Test_LoadConfig() { AutomationAction action = new AutomationAction(); action.Type = "Mouse"; AutomationAction childAction = new AutomationAction(); childAction.Type = "Mouse"; action.AddChild(childAction); AutomationStep step = new AutomationStep(); step.Name = "First"; step.Description = "test"; step.Add(action); WebAutomationConfig config = new WebAutomationConfig(); config.Add(step); AutomationManagement manager = new AutomationManagement(); manager.LoadConfig(config); }
public FindAction(AutomationAction automationActionData) : base(automationActionData) { this.Combine = GetAttributeValue<bool>("combine"); this.Contains = GetAttributeValue<bool>("contains"); this.WildCard = GetAttributeValue<bool>("wildcard"); this.Trim = GetAttributeValue<bool>("trim"); this.ID = GetAttributeValue<string>("id"); this.Name = GetAttributeValue<string>("name"); this.ClassName = GetAttributeValue<string>("class"); this.TagName = GetAttributeValue<string>("tagname"); this.Type = GetAttributeValue<string>("type"); this.Title = GetAttributeValue<string>("title"); this.Url = GetAttributeValue<string>("href"); this.InnerText = GetAttributeValue<string>("innertext"); this.Index = GetAttributeValue<int>("index", -1); this.XPath = GetAttributeValue<string>("xpath"); List<string> embedAttrbuteList = GetAttributeValueStartWith<string>("embed_"); if (embedAttrbuteList != null && embedAttrbuteList.Count > 0) { this.EmbedAttribute = new Dictionary<string, string>(); foreach (string str in embedAttrbuteList) { int index = str.IndexOf(":"); if (index != -1) { string key = str.Substring(0, index); string value = str.Substring(index + 1, str.Length - index - 1); this.EmbedAttribute.Add(key, value); } } } }
public void Test_ConfigurationSerialize() { WebAutomationConfig config = new WebAutomationConfig(); config.Name = "Test1"; config.Version = "0.1"; AutomationStep step = new AutomationStep(); step.Name = "aaa"; step.ActionList = new System.Collections.Generic.List<AutomationAction>(); config.Add(step); AutomationAction action = new AutomationAction(); action.Type = "Wait"; AutomationActionAttribute attr = new AutomationActionAttribute(); attr.Name = "name"; attr.Value = "value"; action.Add(attr); AutomationAction childAction = new AutomationAction(); childAction.Type = "Click"; childAction.Add(attr); action.AddChild(childAction); step.Add(action); WebAutomationConfig.Save(config); WebAutomationConfig loadConfig = WebAutomationConfig.Load(); Assert.IsNotNull(loadConfig); Assert.AreEqual(loadConfig.Name, config.Name); Assert.AreEqual(loadConfig.StepList.Count, config.StepList.Count); Assert.AreEqual(loadConfig.StepList[0].Name, config.StepList[0].Name); }
public ClearDataAction(AutomationAction automationActionData) : base(automationActionData) { }
public SendKeyAction(AutomationAction automationActionData) : base(automationActionData) { this.Keys = GetAttributeValueStartWith<string>("sendkey_"); }
private void LoadConditionAction(IAction action, AutomationAction actionData) { if (actionData.ConditionActionList != null && actionData.ConditionActionList.Count > 0) { foreach (AutomationAction childData in actionData.ConditionActionList) { if (!childData.Enabled) { continue; } IAction childAction = ConvertToAction(childData); if (action.ConditoinAction == null) { action.ConditoinAction = new List<IAction>(); } action.ConditoinAction.Add(childAction); LoadConditionAction(childAction, childData); } } }
private IAction ConvertToAction(AutomationAction actionData) { return ClassLoader.LoadAction(actionData); }
public BrowserAction(AutomationAction automationActionData) : base(automationActionData) { this.Name = GetAttributeValue<string>("name"); this.Url = GetAttributeValue<string>("url"); }
public ConditionAction(AutomationAction automationActionData) : base(automationActionData) { }
public static void Debug(AutomationAction AutomationActionData) { System.Diagnostics.Debug.WriteLine(AutomationActionData.ToString()); }
public void AddChild(AutomationAction childAction) { if (this.ChildActionList == null) { this.ChildActionList = new List<AutomationAction>(); } this.ChildActionList.Add(childAction); }
public WaitAction(AutomationAction automationActionData) : base(automationActionData) { this.Seconds = GetAttributeValue<int>("seconds"); this.Milliseconds = GetAttributeValue<int>("milliseconds"); }
public ClearHistoryAction(AutomationAction automationActionData) : base(automationActionData) { this.ClearHistoryType = GetAttributeValue<ClearHistoryType>("type"); }
public PageAction(AutomationAction automationActionData) : base(automationActionData) { this.MaxPageIndex = this.GetAttributeValue<int>("max", 10); }
public KeyboardAction(AutomationAction automationActionData) : base(automationActionData) { this.KeyDown = GetAttributeValue<bool>("keydown"); this.KeyUp = GetAttributeValue<bool>("keyup"); }
public TimerAction(AutomationAction automationActionData) : base(automationActionData) { this.Seconds = GetAttributeValue<int>("seconds"); }
public ScriptAction(AutomationAction automationActionData) : base(automationActionData) { this.ScriptContent = GetAttributeValue<string>("script"); }
public PackageAction(AutomationAction automationActionData) : base(automationActionData) { }